fix(text_input): conflicts with keyboard focus navigation

This commit is contained in:
Michael Aaron Murphy 2025-03-24 03:36:49 +01:00
parent cb682be3c8
commit ae5bb40d6e
No known key found for this signature in database
GPG key ID: B2732D4240C9212C

View file

@ -647,14 +647,10 @@ where
}; };
} }
if !state if let Some(f) = state.is_focused.as_ref() {
.is_focused if f.updated_at != LAST_FOCUS_UPDATE.with(|f| f.get()) {
.as_ref() state.unfocus();
.map(|f| f.updated_at == LAST_FOCUS_UPDATE.with(|f| f.get())) }
.unwrap_or_default()
{
state.unfocus();
// state.is_read_only = true;
} }
self.is_read_only = state.is_read_only; self.is_read_only = state.is_read_only;
@ -1787,7 +1783,6 @@ pub fn update<'a, Message: Clone + 'static>(
// Or to connect the text input to a button. // Or to connect the text input to a button.
shell.publish(on_tab.clone()); shell.publish(on_tab.clone());
} else { } else {
state.unfocus();
state.is_read_only = true; state.is_read_only = true;
if let Some(on_unfocus) = on_unfocus { if let Some(on_unfocus) = on_unfocus {