mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 23:13:13 -04:00
Don't call scroll if TextEdit is fully in view (#1779)
* Don't call scroll if TextEdit is fully in view * Explain why the new logic was added * cargo fmt Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
@@ -610,7 +610,8 @@ impl<'t> TextEdit<'t> {
|
||||
&cursor_range.primary,
|
||||
);
|
||||
|
||||
if response.changed || selection_changed {
|
||||
let is_fully_visible = ui.clip_rect().contains_rect(rect); // TODO: remove this HACK workaround for https://github.com/emilk/egui/issues/1531
|
||||
if (response.changed || selection_changed) && !is_fully_visible {
|
||||
ui.scroll_to_rect(cursor_pos, None); // keep cursor in view
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user