Skip to content

Commit

Permalink
Update builder.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored Sep 5, 2024
1 parent e02b251 commit d3e8ea6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/egui/src/widgets/text_edit/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ impl<'t> TextEdit<'t> {
});
let mut state = TextEditState::load(ui.ctx(), id).unwrap_or_default();

if !ui.input(|i| i.focused) {
let viewport_has_focus = ui.input(|i| i.focused);
if !viewport_has_focus {
ui.memory_mut(|mem| mem.surrender_focus(id));
}

Expand Down

0 comments on commit d3e8ea6

Please sign in to comment.