Skip to content

[Android]TextBox.InputScope=Number causes cursor to reset when entering non-numeric character #2557

Closed

Description

@XiaotianNetlift

Current behavior

Given this textbox, <TextBox InputScope="Number" />, upon entering any non-numeric character the cursor position resets to back 0.

Expected behavior

Same as uwp, the cursor position should not reset.

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

<TextBox InputScope="Number" />

Environment

Nuget Package: Uno.UI
Package Version(s): 2.1.0-dev.943
Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Windows
  • Build tasks
  • Solution Templates

Visual Studio:

  • 2017 (version: )
  • 2019 (version: )
  • for Mac (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Workaround: The same issue does not happen with if InputScope="TelephoneNumber" were used instead.
Somewhat related: #2038
https://nventive.visualstudio.com/Umbrella/_workitems/edit/166205

Activity

  1. added
    kind/bug
    platform/android 🤖
    triage/untriaged
    on Jan 29, 2020
  2. XiaotianNetlift commented on Jan 29, 2020

    @XiaotianNetlift
    Author
  3. added this to the 3.1 milestone on Aug 29, 2020
  4. removed
    triage/untriaged
    on Aug 29, 2020
  5. removed this from the 3.1 milestone on Aug 31, 2020
  6. added
    project/text 🔤
    on Sep 21, 2020
  7. added
    difficulty/tbd
    on Feb 15, 2021
  8. added
    difficulty/starter 🚀
    and removed
    difficulty/tbd
    on Jun 1, 2021
  9. lukeblevins commented on Jun 1, 2021

    @lukeblevins
    Contributor

    I was able to reproduce this bug in a small Android app for testing with the latest Uno.UI package (3.7.4 and 3.7.6)

    @Xiaoy312 Can confirm that entering a non-numeric character (e.g. space, hyphen) still resets the TextBox cursor position.

    @jeromelaban FYI

  10. lukeblevins commented on Jun 1, 2021

    @lukeblevins
    Contributor

    I'm also interested if this behavior is normal in Android apps. It seems that our implementation of TextBox for android includes an implementation of Android's BaseInputConnection. Is it technically possible to override the platform behavior there to feel like WUX?

    EDIT: Would love to fix this, but not quite sure yet where inside TextBox.Overrides.Android.cs I can override Android's behavior.

  11. added
    good first issue
    on Jun 10, 2021
  12. jeanplevesque commented on Nov 22, 2021

    @jeanplevesque
    Member

    Still happens on Uno.UI 3.11.0-dev.487

  13. agneszitte commented on Dec 22, 2021

    @agneszitte
    Member

    Still happens on Uno.UI 3.11.0-dev.487

    The issue should be closed normally,
    Tested in TZ and with Uno.Material 1.2.0 / Uno.UI 4.0.11, the issue is fixed.
    ( cc @jeromelaban / @jeanplevesque )

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/starter 🚀good first issuekind/bugplatform/android 🤖project/text 🔤

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions