Skip to content

[Android] Fix Keyboard="Numeric" Entry no longer accepts OS-locale decimal separator - #38277

Merged
kubaflo merged 3 commits into
dotnet:inflight/currentfrom
HarishwaranVijayakumar:fix-38213
Sep 7, 2026
Merged

kubaflo merged 3 commits into
dotnet:inflight/currentfrom
HarishwaranVijayakumar:fix-38213

Conversation

@HarishwaranVijayakumar

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details:

  • On Android, an Entry using Keyboard.Numeric no longer accepts the locale-specific decimal separator.
    For example, under Polish culture, pressing , after 1 is ignored instead of producing 1, .

Root Cause of the issue:

  • MAUI installs LocalizedDigitsKeyListener to accept the current culture's decimal separator. However, the password handling introduced by [Android] Fix Entry password visibility when using Keyboard.Password #36280 subsequently executes: editText.InputType &= ~InputTypes.NumberVariationPassword;
  • Even when NumberVariationPassword is already absent, the compound assignment still invokes the InputType setter, which maps to Android's TextView.setInputType() .
  • Android's setInputType() recreates the KeyListener to match the supplied input type. For ClassNumber , it installs Android's DigitsKeyListener , replacing MAUI's LocalizedDigitsKeyListener .
  • The replacement listener does not accept the Polish decimal separator in this configuration. Therefore, when the IME commits , , the numeric input filter removes it and the text remains 1 .
  • The password flag itself does not reject the comma. The regression is caused by the additional InputType assignment replacing the localized listener.

Description of Change

Localization and Numeric Keyboard Support:

  • Added a test (NumericKeyboardAcceptsPolishDecimalSeparator) to verify that the numeric keyboard accepts the Polish decimal separator (comma) when the culture is set to Polish (pl-PL). The test checks that the correct input type flags are set and that the text input works as expected.

Input Type Handling Improvements:

  • Updated SetInputType in EditTextExtensions.cs to only clear the password variation flags (TextVariationPassword, NumberVariationPassword) if both the class and variation flags are present, making the logic more robust and preventing unintended flag removal.

Issues Fixed

Fixes #38213

Tested the behavior in the following platforms

  • Windows
  • Android
  • iOS
  • Mac

Output

Before After
Beforefix-38213.mov
Afterfix-38213.mov

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38277

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38277"

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Sep 7, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @@HarishwaranVijayakumar! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Sep 7, 2026
@HarishwaranVijayakumar HarishwaranVijayakumar changed the title [WIP] [Android] Fix Keyboard="Numeric" Entry no longer accepts OS-locale decimal separator [Android] Fix Keyboard="Numeric" Entry no longer accepts OS-locale decimal separator Sep 7, 2026
@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests , maui-pr-devicetests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is narrowly scoped, aligns with the described root cause, and includes a focused regression test that verifies both behavior and the correct KeyListener is retained.

Pull request overview

This PR fixes an Android regression where Entry with Keyboard.Numeric stops accepting the OS/app-locale decimal separator (e.g., , in pl-PL) because a redundant InputType assignment causes Android to recreate the KeyListener, replacing MAUI’s LocalizedDigitsKeyListener.

Changes:

  • Updated Android EditTextExtensions.SetInputType to only clear password-variation flags when they’re actually present, avoiding unnecessary InputType setter calls that reset the numeric KeyListener.
  • Added an Android device test to validate that under pl-PL, numeric input accepts , and that LocalizedDigitsKeyListener remains installed.
File summaries
File Description
src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Android.cs Adds a regression device test for Polish decimal separator acceptance and verifies LocalizedDigitsKeyListener + numeric input flags.
src/Core/src/Platform/Android/EditTextExtensions.cs Prevents unnecessary InputType setter invocation when password-variation flags aren’t set, preserving the localized numeric KeyListener.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

@kubaflo
kubaflo changed the base branch from main to inflight/current September 7, 2026 15:58
kubaflo and others added 2 commits September 7, 2026 18:06
Preserve the locale-aware numeric Entry regression test alongside the newly added Android accessibility coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 169298fa-95aa-47a4-ad1c-512dc3f97871
Bring in the latest GradientBrush lifecycle fix after resolving the Entry test conflict.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 169298fa-95aa-47a4-ad1c-512dc3f97871
@kubaflo

kubaflo commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Resolved the conflicts against the latest inflight/current and pushed merge commit fcdc59ea7a.

The conflict in EntryHandlerTests.Android.cs was combined so the PR’s Polish decimal-separator regression test is retained alongside the target branch’s new accessibility content-description test. The production EditTextExtensions fix remains unchanged.

The Android Core device-test app built successfully, and the Entry-filtered run completed with 241 tests: 239 passed, 2 ignored, and 0 failed. NumericKeyboardAcceptsPolishDecimalSeparator passed. GitHub now reports the PR as mergeable.

@kubaflo
kubaflo merged commit 64094b5 into dotnet:inflight/current Sep 7, 2026
4 of 12 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR11 milestone Sep 7, 2026
kubaflo added a commit that referenced this pull request Sep 7, 2026
…cimal separator (#38277)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details:

- On Android, an Entry using Keyboard.Numeric no longer accepts the
locale-specific decimal separator.
For example, under Polish culture, pressing , after 1 is ignored instead
of producing 1, .

### Root Cause of the issue:

- MAUI installs LocalizedDigitsKeyListener to accept the current
culture's decimal separator. However, the password handling introduced
by #36280 subsequently executes: editText.InputType &=
~InputTypes.NumberVariationPassword;
- Even when NumberVariationPassword is already absent, the compound
assignment still invokes the InputType setter, which maps to Android's
TextView.setInputType() .
- Android's setInputType() recreates the KeyListener to match the
supplied input type. For ClassNumber , it installs Android's
DigitsKeyListener , replacing MAUI's LocalizedDigitsKeyListener .
- The replacement listener does not accept the Polish decimal separator
in this configuration. Therefore, when the IME commits , , the numeric
input filter removes it and the text remains 1 .
- The password flag itself does not reject the comma. The regression is
caused by the additional InputType assignment replacing the localized
listener.

### Description of Change

**Localization and Numeric Keyboard Support:**
* Added a test (`NumericKeyboardAcceptsPolishDecimalSeparator`) to
verify that the numeric keyboard accepts the Polish decimal separator
(comma) when the culture is set to Polish (`pl-PL`). The test checks
that the correct input type flags are set and that the text input works
as expected.

**Input Type Handling Improvements:**
* Updated `SetInputType` in `EditTextExtensions.cs` to only clear the
password variation flags (`TextVariationPassword`,
`NumberVariationPassword`) if both the class and variation flags are
present, making the logic more robust and preventing unintended flag
removal.


### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #38213 

### Tested the behavior in the following platforms
 
- [ ] Windows
- [x] Android
- [ ] iOS
- [ ] Mac

### Output
 
| Before | After |
|----------|----------|
| <video
src="https://github.com/user-attachments/assets/6f5221df-e597-439c-b44b-b2acaa95e4ee">
| <video
src="https://github.com/user-attachments/assets/e950f42d-87e3-4908-b7b1-24b5249acf68">
|


<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 169298fa-95aa-47a4-ad1c-512dc3f97871
kubaflo added a commit that referenced this pull request Sep 8, 2026
…cimal separator (#38277)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details:

- On Android, an Entry using Keyboard.Numeric no longer accepts the
locale-specific decimal separator.
For example, under Polish culture, pressing , after 1 is ignored instead
of producing 1, .

### Root Cause of the issue:

- MAUI installs LocalizedDigitsKeyListener to accept the current
culture's decimal separator. However, the password handling introduced
by #36280 subsequently executes: editText.InputType &=
~InputTypes.NumberVariationPassword;
- Even when NumberVariationPassword is already absent, the compound
assignment still invokes the InputType setter, which maps to Android's
TextView.setInputType() .
- Android's setInputType() recreates the KeyListener to match the
supplied input type. For ClassNumber , it installs Android's
DigitsKeyListener , replacing MAUI's LocalizedDigitsKeyListener .
- The replacement listener does not accept the Polish decimal separator
in this configuration. Therefore, when the IME commits , , the numeric
input filter removes it and the text remains 1 .
- The password flag itself does not reject the comma. The regression is
caused by the additional InputType assignment replacing the localized
listener.

### Description of Change

**Localization and Numeric Keyboard Support:**
* Added a test (`NumericKeyboardAcceptsPolishDecimalSeparator`) to
verify that the numeric keyboard accepts the Polish decimal separator
(comma) when the culture is set to Polish (`pl-PL`). The test checks
that the correct input type flags are set and that the text input works
as expected.

**Input Type Handling Improvements:**
* Updated `SetInputType` in `EditTextExtensions.cs` to only clear the
password variation flags (`TextVariationPassword`,
`NumberVariationPassword`) if both the class and variation flags are
present, making the logic more robust and preventing unintended flag
removal.


### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #38213 

### Tested the behavior in the following platforms
 
- [ ] Windows
- [x] Android
- [ ] iOS
- [ ] Mac

### Output
 
| Before | After |
|----------|----------|
| <video
src="https://github.com/user-attachments/assets/6f5221df-e597-439c-b44b-b2acaa95e4ee">
| <video
src="https://github.com/user-attachments/assets/e950f42d-87e3-4908-b7b1-24b5249acf68">
|


<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 169298fa-95aa-47a4-ad1c-512dc3f97871
kubaflo added a commit that referenced this pull request Sep 9, 2026
…cimal separator (#38277)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details:

- On Android, an Entry using Keyboard.Numeric no longer accepts the
locale-specific decimal separator.
For example, under Polish culture, pressing , after 1 is ignored instead
of producing 1, .

### Root Cause of the issue:

- MAUI installs LocalizedDigitsKeyListener to accept the current
culture's decimal separator. However, the password handling introduced
by #36280 subsequently executes: editText.InputType &=
~InputTypes.NumberVariationPassword;
- Even when NumberVariationPassword is already absent, the compound
assignment still invokes the InputType setter, which maps to Android's
TextView.setInputType() .
- Android's setInputType() recreates the KeyListener to match the
supplied input type. For ClassNumber , it installs Android's
DigitsKeyListener , replacing MAUI's LocalizedDigitsKeyListener .
- The replacement listener does not accept the Polish decimal separator
in this configuration. Therefore, when the IME commits , , the numeric
input filter removes it and the text remains 1 .
- The password flag itself does not reject the comma. The regression is
caused by the additional InputType assignment replacing the localized
listener.

### Description of Change

**Localization and Numeric Keyboard Support:**
* Added a test (`NumericKeyboardAcceptsPolishDecimalSeparator`) to
verify that the numeric keyboard accepts the Polish decimal separator
(comma) when the culture is set to Polish (`pl-PL`). The test checks
that the correct input type flags are set and that the text input works
as expected.

**Input Type Handling Improvements:**
* Updated `SetInputType` in `EditTextExtensions.cs` to only clear the
password variation flags (`TextVariationPassword`,
`NumberVariationPassword`) if both the class and variation flags are
present, making the logic more robust and preventing unintended flag
removal.


### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #38213 

### Tested the behavior in the following platforms
 
- [ ] Windows
- [x] Android
- [ ] iOS
- [ ] Mac

### Output
 
| Before | After |
|----------|----------|
| <video
src="https://github.com/user-attachments/assets/6f5221df-e597-439c-b44b-b2acaa95e4ee">
| <video
src="https://github.com/user-attachments/assets/e950f42d-87e3-4908-b7b1-24b5249acf68">
|


<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 169298fa-95aa-47a4-ad1c-512dc3f97871
kubaflo added a commit that referenced this pull request Sep 11, 2026
…cimal separator (#38277)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details:

- On Android, an Entry using Keyboard.Numeric no longer accepts the
locale-specific decimal separator.
For example, under Polish culture, pressing , after 1 is ignored instead
of producing 1, .

### Root Cause of the issue:

- MAUI installs LocalizedDigitsKeyListener to accept the current
culture's decimal separator. However, the password handling introduced
by #36280 subsequently executes: editText.InputType &=
~InputTypes.NumberVariationPassword;
- Even when NumberVariationPassword is already absent, the compound
assignment still invokes the InputType setter, which maps to Android's
TextView.setInputType() .
- Android's setInputType() recreates the KeyListener to match the
supplied input type. For ClassNumber , it installs Android's
DigitsKeyListener , replacing MAUI's LocalizedDigitsKeyListener .
- The replacement listener does not accept the Polish decimal separator
in this configuration. Therefore, when the IME commits , , the numeric
input filter removes it and the text remains 1 .
- The password flag itself does not reject the comma. The regression is
caused by the additional InputType assignment replacing the localized
listener.

### Description of Change

**Localization and Numeric Keyboard Support:**
* Added a test (`NumericKeyboardAcceptsPolishDecimalSeparator`) to
verify that the numeric keyboard accepts the Polish decimal separator
(comma) when the culture is set to Polish (`pl-PL`). The test checks
that the correct input type flags are set and that the text input works
as expected.

**Input Type Handling Improvements:**
* Updated `SetInputType` in `EditTextExtensions.cs` to only clear the
password variation flags (`TextVariationPassword`,
`NumberVariationPassword`) if both the class and variation flags are
present, making the logic more robust and preventing unintended flag
removal.


### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #38213 

### Tested the behavior in the following platforms
 
- [ ] Windows
- [x] Android
- [ ] iOS
- [ ] Mac

### Output
 
| Before | After |
|----------|----------|
| <video
src="https://github.com/user-attachments/assets/6f5221df-e597-439c-b44b-b2acaa95e4ee">
| <video
src="https://github.com/user-attachments/assets/e950f42d-87e3-4908-b7b1-24b5249acf68">
|


<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 169298fa-95aa-47a4-ad1c-512dc3f97871
@kubaflo

kubaflo commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

/backport to release/10.0.1xx-sr11

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0.1xx-sr11 (link to workflow run)

@kubaflo

kubaflo commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

/backport to main

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to main (link to workflow run)

kubaflo added a commit that referenced this pull request Sep 12, 2026
…cale decimal separator (#38485)

Backport of #38277 to main

/cc @kubaflo @HarishwaranVijayakumar

Co-authored-by: HarishwaranVijayakumar <harishwaran.vijayakumar@syncfusion.com>
Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 169298fa-95aa-47a4-ad1c-512dc3f97871
kubaflo added a commit that referenced this pull request Sep 12, 2026
…ger accepts OS-locale decimal separator (#38483)

Backport of #38277 to release/10.0.1xx-sr11

/cc @kubaflo @HarishwaranVijayakumar

Co-authored-by: HarishwaranVijayakumar <harishwaran.vijayakumar@syncfusion.com>
Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 169298fa-95aa-47a4-ad1c-512dc3f97871
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-entry Entry community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] Keyboard="Numeric" Entry no longer accepts OS-locale decimal separator (e.g. comma in PL)

4 participants