Fix`TextEdit` selection when placed in a `Scene`. (#5791)

* Closes https://github.com/emilk/egui/issues/5789
* [x] I have followed the instructions in the PR template

While this change fixes the TextEdit specific issue, I'm worried that
the underlying problem is more fundamental and could show up in other
widgets, and I'm wondering if there's a more general solution?
This commit is contained in:
Adrian Blumer 2025-03-17 02:00:47 -07:00 committed by GitHub
parent d811940dcc
commit eb7ca72534
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -578,7 +578,7 @@ impl TextEdit<'_> {
let painter = ui.painter_at(text_clip_rect.expand(1.0)); // expand to avoid clipping cursor
if interactive {
if let Some(pointer_pos) = ui.ctx().pointer_interact_pos() {
if let Some(pointer_pos) = response.interact_pointer_pos() {
if response.hovered() && text.is_mutable() {
ui.output_mut(|o| o.mutable_text_under_cursor = true);
}