Disable dismissal of keyboard after message sent on mobile
This commit is contained in:
parent
df8337fea4
commit
0e4d29ae52
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user