You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a textbox get focus by clicking then selected text is deselected.
To Reproduce
mybox.GotFocus += (_, _) => mybox.SelectAll();
Expected behavior
With the code above mybox should whenever it get focus select all text which it does. However it seems that when it get's focus from a pointer event it deselects all text and it does that after the focus event code has been run.
Avalonia version
11.1.3
OS
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
You need to handle the pointer event so that the TextBox will not, at least for this narrow scenario (and allow it to handle other scenarios). I've written an attached behavior for this which should work for either clicking or any other focus-related trigger (like tab navigation).
If you don't wish to use behaviors, you can follow the event implementation above. You still need to subscribe to PointerPressed with a tunneling event (not a bubbling event like you're doing).
Describe the bug
If a textbox get focus by clicking then selected text is deselected.
To Reproduce
mybox.GotFocus += (_, _) => mybox.SelectAll();
Expected behavior
With the code above mybox should whenever it get focus select all text which it does. However it seems that when it get's focus from a pointer event it deselects all text and it does that after the focus event code has been run.
Avalonia version
11.1.3
OS
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: