Repository navigation
fix: Fix InputScope issues on Android and Wasm - #7074
Conversation
22b7bdb to
5071886
Compare
| if (_textBoxView != null) | ||
| { | ||
| _textBoxView.InputType = types; | ||
| _textBoxView.SetRawInputType(types); |
There was a problem hiding this comment.
This is likely to be a breaking change for application current expecting uno to do the validation. This new behavior is likely to be the right one, though. We should be placing this behind a feature flag.
There was a problem hiding this comment.
@jeromelaban To be more clear about the current behavior, we indeed was mapping to an Android API that does validation, but somehow, Uno managed to skip/override the native validation(probably this? not sure), but anyway the result was the cursor moving to the beginning after every invalid character.
So I don't expect anyone to be relying on the current behavior.
There was a problem hiding this comment.
I agree that the behavior is different yet the actual keyboard behavior is different from the SIP where the characters don't show at all (and the cursor position does not change). It'd be best to have this specific change behind a disabled flag, mark it as a breaking change in the conventional commit and explain how the flag works.
There was a problem hiding this comment.
where the characters don't show at all (and the cursor position does not change)
I'm not sure what SIP is, but this is not the current behavior nor the new behavior per my testing.
There was a problem hiding this comment.
SIP is Soft Input Panel (the on-screen keyboard). The old behavior was that keys outside the input type would not be entered at all if using a physical keyboard (and the cursor would not more).
There was a problem hiding this comment.
@jeromelaban Thanks, got it and addressed the feedback.
99f024e to
8024261
Compare
BREAKING CHANGE: Introduces a breaking change for InputScope that is controlled by FeatureConfiguration.TextBox.UseLegacyInputScope
8024261 to
7a28cd2
Compare
|
Looks like the failing tests are related to this issue: TextBox_IsReadOnly_AcceptsReturn_Test and TextBox_AutoGrow_Vertically_Test on android. Can you take a look ? |
|
@jeromelaban I looked at In UWP: <TextBox x:Name="TargetTextBox"
AcceptsReturn="True"
IsReadOnly="True"
Text="lorem
ipsum" />and <TextBox x:Name="TargetTextBox"
Text="lorem
ipsum"
AcceptsReturn="True"
IsReadOnly="True" />are different. The order of setting properties matters here because The failing test is setting the text first, so the text gets cut to one line only. So the expectation of height differences is NOT correct for this particular test. The actual case that might be regressing is when |
|
Let's move this PR to the API alignments branch, as it is a subtle breaking change. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
GitHub Issue (If applicable): closes #5207, closes #2557, closes #1389
PR Type
What kind of change does this PR introduce?
What is the current behavior?
On Android:
InputScopemaps toinputTypeson Android, which does validation.On Wasm:
InputScopedoesn't do anything.What is the new behavior?
On Android:
SetRawInputType, which only changes the keyboard but allows any input.On Wasm:
inputmodeattribute which changes the keyboard but allows any input.PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information
I didn't find a way to test how the keyboard shows (at best to my knowledge, we can only validate that any input is allowed).
Internal Issue (If applicable):