diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index 51a663ce5..a9151f9cd 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -1933,7 +1933,7 @@ impl Context { } } -/// Callbacks +/// Plugins impl Context { /// Call the given callback at the start of each pass of each viewport. /// @@ -2945,6 +2945,15 @@ impl Context { self.egui_wants_keyboard_input() } + /// Is the currently focused widget a text edit? + pub fn text_edit_focused(&self) -> bool { + if let Some(id) = self.memory(|mem| mem.focused()) { + crate::text_edit::TextEditState::load(self, id).is_some() + } else { + false + } + } + /// Highlight this widget, to make it look like it is hovered, even if it isn't. /// /// If you call this after the widget has been fully rendered,