Disable dismissal of keyboard after message sent on mobile

This commit is contained in:
pjht 2024-10-08 21:29:32 -05:00
parent df8337fea4
commit 0e4d29ae52
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E

View File

@ -70,12 +70,12 @@ impl Home {
}
}
fn on_mobile() -> bool {
let window = web_sys::window().unwrap();
let navigator = window.navigator();
navigator.max_touch_points() > 0 || window.inner_width().unwrap().as_f64().unwrap() < 768.0
}
//fn on_mobile() -> bool {
// let window = web_sys::window().unwrap();
// let navigator = window.navigator();
//
// navigator.max_touch_points() > 0 || window.inner_width().unwrap().as_f64().unwrap() < 768.0
//}
impl Component for Home {
type Message = HomeMessage;
@ -102,9 +102,9 @@ impl Component for Home {
.unwrap();
let msg = input.value();
input.set_value("");
if on_mobile() {
input.blur().unwrap();
}
//if on_mobile() {
// input.blur().unwrap();
//}
Some(HomeMessage::SubmittedMessage(msg))
} else {
None