Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Samsung Device, Numeric Keyboard -> No comma, dot event not fired #1898

Closed
OPunktSchmidt opened this issue Feb 16, 2018 · 13 comments
Closed

Comments

@OPunktSchmidt
Copy link

OPunktSchmidt commented Feb 16, 2018

Description

When i create an entry with keyboardtype numeric and run my app on samsung devices, the keyboard shows not a comma key (,). It only shows a dot key (.). But when i press the dot key, the TextChanged event is not fired.

We confirmed this behavior on a Samsung Galaxy Tab A (2016) and Samsung A5. When we install an other keyboard than the standard samsung keyboard (like SwiftKey) it works but this would be not an user-friendly solution. Numeric keyboard works correctly on devices from HTC, Sony, LG etc.

Steps to Reproduce

Xamarin.Forms.Entry entry = new Xamarin.Forms.Entry();
entry.Keyboard = Xamarin.Forms.Keyboard.Numeric;

Run this on an actual samsung device.

Expected Behavior

It would be optimal if the comma key is displayed and working. Alternatively, but should at least the dot key fire the TextChanged Event.

Actual Behavior

The keyboard shows not a comma key (,). It only shows a dot key (.). But when i press the dot key, the TextChanged ist not fired.

Basic Information

  • Version with issue: 2.5.0.91635
  • Last known good version: I do not know exactly but any version of august or september 2017
  • IDE: Visual Studio 2017
  • Platform Target Frameworks:
    • iOS: 9.0
    • Android: 8.0
  • Affected Devices: All actual Samsung devices

Screenshots

https://ibb.co/hiTnFn

@jassmith
Copy link

jassmith commented Feb 16, 2018

What language do you have set as your testing locale?

@OPunktSchmidt
Copy link
Author

German

@jassmith
Copy link

Upon review this is an issue with the custom Samsung keyboards themselves. They do not respect the current locale and thus result in the wrong keys being displayed. I don't think there is any way for us to fix this however I would be excited to hear if there is one.

The best advice I can give is don't use a numeric keyboard on samsung phones on locales that use a , separator :/

@harrykimpel
Copy link

harrykimpel commented Oct 24, 2018

I think I found a solution for the comma issue on Samsung devices. I am using a custom Entry implementation in platform independent XAML content page. In the Android project I am then using a custom entry renderer that overrides the OnElementChanged method. My sample code snippet looks like this:

`protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);

        if (Control != null)
        {
            this.Control.KeyListener = DigitsKeyListener.GetInstance(true, true); // I know this is deprecated, but haven't had time to test the code without this line, I assume it will work without
            this.Control.InputType = Android.Text.InputTypes.ClassNumber | Android.Text.InputTypes.NumberFlagDecimal;
        }
    }`

That does the trick for me and now I can enter commas also on Samsung devices.

@mknotzer
Copy link

Great work around, saved my day!

@danieltabarest
Copy link

@harrykimpel thanks for the help, it works for me.

@pigiax
Copy link

pigiax commented Feb 6, 2019

Great! The workaround works like charm

@wagenheimer
Copy link

Please, anybody could please post the complete solution to Workaround this?

@EmilAlipiev
Copy link
Contributor

You have asked on xamarin forums and there is reply there. It didnt help?

@wagenheimer
Copy link

The reply here is a bit different of others I tested and that didn't work. I just implemented it, but I don't have a Samsung Device to test it. My client will test it tomorrow and then give a feedback if it worked or not.

@EmilAlipiev
Copy link
Contributor

As i wrote on forum, reply here is outdated. Please follow forum reply and if you have any further question you can ask there

@VirtualNomad00
Copy link

As i wrote on forum, reply here is outdated. Please follow forum reply and if you have any further question you can ask there

Can you post the link to the forum

@AlexxSilva
Copy link

This solution works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants