dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.15k stars 1.74k forks source link

[Entry] Cursor makes undesired jumps #6916

Closed SotoiGhost closed 2 years ago

SotoiGhost commented 2 years ago

Description

Testcase: https://github.com/SotoiGhost/MauiEntryConverterIssue

On iOS, if you set the TextTransform to Uppercase the cursor jumps to the end of the TextBox if you try to put text in between:

https://user-images.githubusercontent.com/5924210/167231676-55abd9e3-d000-4cf8-91df-568ee74b188d.mov

With Lowercase, the same happens when you try to capitalize a letter:

https://user-images.githubusercontent.com/5924210/167231956-c98629bd-7d99-4fde-91c7-3dadb6d009b4.mov

The same behavior happens if you set IsPassword to True.


On iOS and Android if you use a Converter with the Text property, the cursor jumps to infinity and beyond.

On iOS, the cursor jumps to the end of the text

https://user-images.githubusercontent.com/5924210/167232155-7f33a557-fe0d-439b-9796-13bb95d1f54d.mov

On Android, it jumps to the beginning of the text

https://user-images.githubusercontent.com/5924210/167232175-fb83c274-885d-4a5d-9975-88420b60c9f2.mp4

Steps to Reproduce

<Entry 
    TextTransform="Uppercase" />

<Entry 
    Text="{Binding SubtotalBill, Mode=TwoWay, Converter={x:StaticResource NumberToCurrency}}" />

The Converter and ViewModel are within the testcase linked.

Version with bug

Release Candidate 2 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

iOS 15, Android 12

Did you find any workaround?

No response

Relevant log output

No response

v-longmin commented 2 years ago

Verified repro on Android 12.0 & iOS 15.4. Repro project: MauiEntryConverterIssue-main.zip

IeuanWalker commented 2 years ago

@SotoiGhost I presume your PR would also fix the issue I just linked? (uses a behaviour on an entry)