Skip to content

[Android] TextBox with InputScope as CurrencyAmount move the cursor on the left when pressing comma. #5207

Closed

Description

@takla21

Current behavior

As you can see, the cursor moves to the left after pressing the comma.

ezgif com-video-to-gif

Expected behavior

It should not move the cursor what so ever after pressing the comma by default. This behavior does not happend on neither xamarin.classic nor native.

Xamarin.Classic TextBoxCurrency_Xamarin.zip
ezgif com-video-to-gif

Native TextBoxCurrency_Native.zip
ezgif com-video-to-gif

How to reproduce it (as minimally and precisely as possible)

Download this sample TextBoxCurrency_Uno.zip
Deploy on Android
Try to enter "2,2"

Workaround

I mean I could use a similar InputScope (for instance NumberFullWidth) for now. Ideally, I would need a way to import what works on the xamarin sample into my project as a workaround but I couldn't figure it out if it's even possible.

<EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:digits="1234567890,." // <-- Have this one too, so I can actually press the comma key.
        android:inputType="numberDecimal" // <-- If I could somehow use this one.
        android:text="" />

Environment

Nuget Package:

  • Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
  • Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
  • Uno.SourceGenerationTasks
  • Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
  • Other:

Nuget Package Version(s): 3.6.0-dev.27

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows
  • Build tasks
  • Solution Templates

IDE:

  • Visual Studio 2017 (version: )
  • Visual Studio 2019 (version: 16.8.4)
  • Visual Studio for Mac (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )
  • Visual Studio Code (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Activity

  1. added
    kind/bug
    triage/untriaged
    platform/android 🤖
    on Feb 10, 2021
  2. added
    difficulty/tbd
    on Feb 15, 2021
  3. added
    difficulty/medium 🤔
    project/input ⌨️
    good first issue
    and removed
    difficulty/tbd
    triage/untriaged
    on Jun 3, 2021
  4. Youssef1313 commented on Aug 2, 2021

    @Youssef1313
    Member

    Possibly duplicate of #2557

  5. Youssef1313 commented on Sep 14, 2021

    @Youssef1313
    Member

    The issue here is the InputScope in UWP just changes the touch screen keyboard, but don't do any validation. However, Android's inputType does validation and don't allow entering , for example. (I'm not sure how Uno managed to enter the comma while it's completely disallowed in Android)

    We need a way to only change the keyboard, but without doing validation. I didn't manage to do that in native Android.

  6. francoistanguay commented on Jan 10, 2022

    @francoistanguay
    Contributor

    Can we test again @takla21 ?

  7. takla21 commented on Jan 10, 2022

    @takla21
    ContributorAuthor

    Yeah I've tested on the latest dev uno version 4.1.0-dev.283 and the issue is gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

difficulty/medium 🤔good first issuekind/bugplatform/android 🤖project/input ⌨️

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions