-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Windows] Fix select-all Entry select logic #23329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ts even if the value is the same This allows "select all text on focus" logic to work on WinUI
| { | ||
| get { return (int)GetValue(CursorPositionProperty); } | ||
| set { SetValue(CursorPositionProperty, value); } | ||
| set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@StephaneDelcroix thoughts on this?
PureWeen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better solution might be adding a Select and SelectAll method to Entry, but for now this will work.
We could just add this for now via the command mappers. Would that be a better solution here then firing the UpdateValue everytime?
Now in net9 with the new overrides, we could just target this to net9 and then fire a commandmapper that does the "SelectAll" behavior.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/rebase |
…ts even if the value is the same This allows "select all text on focus" logic to work on WinUI
…onLength` properties
f524584 to
ab808ea
Compare
|
/rebase |
|
Has this code been merged? The issue is pretty old but we still have a pending issue open that references this fix and from what I see on this page, the PR has been "running" since January so I just want to be sure someone has this in their sights. |
Description of Change
Consider that you want to implement a "select all text on focus" function for an Entry field:
Currently, this will work the first time the Entry is focused, but it won't work the second time.
The problem is caused by the following:
The fix here is to just always ensure setting cursor position and selection length flows to the native WinUI TextBox control. A better solution might be adding a
SelectandSelectAllmethod toEntry, but for now this will work.