input: Clean focused_input on Input blur. (#825)
This commit is contained in:
parent
69dad78867
commit
6dea2cb57c
2 changed files with 4 additions and 2 deletions
|
|
@ -514,7 +514,6 @@ impl Element for TextElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
// And reset focused_input when next_frame start
|
// And reset focused_input when next_frame start
|
||||||
|
|
||||||
window.on_next_frame({
|
window.on_next_frame({
|
||||||
let input_view = self.input.clone();
|
let input_view = self.input.clone();
|
||||||
move |window, cx| {
|
move |window, cx| {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use crate::indicator::Indicator;
|
||||||
use crate::input::clear_button;
|
use crate::input::clear_button;
|
||||||
use crate::scroll::{Scrollbar, ScrollbarAxis, ScrollbarState};
|
use crate::scroll::{Scrollbar, ScrollbarAxis, ScrollbarState};
|
||||||
use crate::{h_flex, StyledExt};
|
use crate::{h_flex, StyledExt};
|
||||||
use crate::ActiveTheme;
|
use crate::{ActiveTheme, Root};
|
||||||
use crate::{IconName, Size};
|
use crate::{IconName, Size};
|
||||||
use crate::{Sizable, StyleSized};
|
use crate::{Sizable, StyleSized};
|
||||||
|
|
||||||
|
|
@ -1490,6 +1490,9 @@ impl TextInput {
|
||||||
self.blink_cursor.update(cx, |cursor, cx| {
|
self.blink_cursor.update(cx, |cursor, cx| {
|
||||||
cursor.stop(cx);
|
cursor.stop(cx);
|
||||||
});
|
});
|
||||||
|
Root::update(window, cx, |root, _, _| {
|
||||||
|
root.focused_input = None;
|
||||||
|
});
|
||||||
cx.emit(InputEvent::Blur);
|
cx.emit(InputEvent::Blur);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue