Skip to content
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

Text selection works incorrectly for TextBoxes in adorner layer #15480

Open
BAndysc opened this issue Apr 23, 2024 · 1 comment · May be fixed by #15484
Open

Text selection works incorrectly for TextBoxes in adorner layer #15480

BAndysc opened this issue Apr 23, 2024 · 1 comment · May be fixed by #15484
Labels

Comments

@BAndysc
Copy link
Contributor

BAndysc commented Apr 23, 2024

Describe the bug

When a TextBox is attached as an adorner, then text selection doesn't work correctly - it ignores the placement of the adorned element.

Screen.Recording.2024-04-23.at.14.41.22.mov

To Reproduce

  1. git clone https://github.com/BAndysc/avalonia-bugs-repro
  2. git checkout bug_textbox_selection_adorner
  3. Try to select the text in textbox

Expected behavior

No response

Avalonia version

11.0.10, 11.1

OS

No response

Additional context

No response

@BAndysc BAndysc added the bug label Apr 23, 2024
@BAndysc BAndysc changed the title Text selection works incorrectly for TextBoxes in adorner layers Text selection works incorrectly for TextBoxes in adorner layer Apr 23, 2024
@BAndysc
Copy link
Contributor Author

BAndysc commented Apr 23, 2024

Unfortunately it is related to #14439

PointerEventArgs uses TransformToVisual extension to calculate press position

return pt * _rootVisual.TransformToVisual(relativeTo) ?? default;

but TransformToVisual doesn't work with Adorners :( sadly, adorners are defined in another assembly (Avalonia.Controls), TransformToVisual is in Avalonia.Base so this method can't be easily modified to take into account adorners

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant