Skip to content

Fix MaxLength handling on Android and WASM - #1353

Merged
leboeuf merged 3 commits into
masterfrom
dev/male/158910-textbox-maxlength
Aug 8, 2019
Merged

leboeuf merged 3 commits into
masterfrom
dev/male/158910-textbox-maxlength

Conversation

@leboeuf

@leboeuf leboeuf commented Aug 8, 2019 •

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): #n/a

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

On Android:

  • After MaxLength is reached, text gets overwritten by subsequent characters. For example, if MaxLength=5, typing '123456' will result in '62345'.
  • After MaxLength is reached, the BeforeTextChanging event is still called for subsequent characters. This is not the case on UWP.

On WASM: The MaxLength property is not respected.

What is the new behavior?

On Android and WASM:

  • The user is prevented from typing more text when MaxLength is reached.
  • After MaxLength is reached, the BeforeTextChanging event is not triggered for subsequent characters (like on UWP).

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Docs have been added/updated which fit documentation template. (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Updated the Release Notes
  • Associated with an issue (GitHub or internal)

Other information

Internal Issue (If applicable):

https://nventive.visualstudio.com/Umbrella/_workitems/edit/158910

@leboeuf leboeuf added kind/bug Something isn't working platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform labels Aug 8, 2019
@leboeuf
leboeuf requested a review from davidjohnoliver August 8, 2019 16:19
@davidjohnoliver

davidjohnoliver commented Aug 8, 2019 •

Copy link
Copy Markdown
Contributor

Nice! A couple of points:

  1. Remove the previous faulty code (OnMaxLengthChangedPartial in TextBox.Android.cs)
  2. We'd like to have a UI test verifying this behaviour. There's help on adding UI tests here: https://github.com/unoplatform/uno/blob/master/doc/articles/uno-development/working-with-the-samples-apps.md and you can use the existing TextBox tests as a starting point: https://github.com/unoplatform/uno/blob/master/src/SamplesApp/SamplesApp.UITests/UnoSamples_Tests.Keyboard.cs
GitHub
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported. - unoplatform/uno
GitHub
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported. - unoplatform/uno

@leboeuf
leboeuf merged commit 59a911c into master Aug 8, 2019
@delete-merged-branch
delete-merged-branch Bot deleted the dev/male/158910-textbox-maxlength branch August 8, 2019 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants