Skip to content

Commit

Permalink
focus search bar's text box when focusing toolbar itself
Browse files Browse the repository at this point in the history
- toolbar focus makes no sense anyway, because it does not interact with keyboard, but text box does
  • Loading branch information
mrDIMAS committed Nov 10, 2024
1 parent feb656d commit 60ddae6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fyrox-ui/src/searchbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#![warn(missing_docs)]

use crate::widget::WidgetMessage;
use crate::{
border::BorderBuilder,
brush::Brush,
Expand Down Expand Up @@ -121,6 +122,11 @@ impl Control for SearchBar {
MessageDirection::ToWidget,
text.clone(),
));
} else if let Some(WidgetMessage::Focus) = message.data() {
ui.send_message(WidgetMessage::focus(
*self.text_box,
MessageDirection::ToWidget,
));
}
}

Expand Down

0 comments on commit 60ddae6

Please sign in to comment.