diff options
author | Lorn Potter <[email protected]> | 2023-11-28 11:20:15 +1000 |
---|---|---|
committer | Qt Cherry-pick Bot <[email protected]> | 2024-01-06 01:14:03 +0000 |
commit | 1acd96c7e8b3e3e2c98f6dd39bc16411b4783a85 (patch) | |
tree | 0872b3db40c6bb3a8768c343e4d1a50cad443f39 | |
parent | d38b2e0cc102167dabf9c844dfb8d8b30c33f6bf (diff) |
wasm: prevent native mobile keyboard from popping up always
also fix misspelled 'inputMode' which seems to work.
we need to re focus to the canvas when window is raised
which will automagically close the native keyboard
when user clicks on non edit area.
Fixes: QTBUG-101404
Change-Id: Iced9abc7b23e079b1060d2474a139aa653a8ca01
Reviewed-by: Morten Johan Sørvig <[email protected]>
Reviewed-by: Piotr Wierciński <[email protected]>
(cherry picked from commit d784c14d101ebb1c357cf3096d99e7e9be274931)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit a78d5c8559381df5c02be045e0ddc67e2629a283)
-rw-r--r-- | src/plugins/platforms/wasm/qwasmwindow.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp index 6b63151e21d..cd8846b7475 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.cpp +++ b/src/plugins/platforms/wasm/qwasmwindow.cpp @@ -80,9 +80,9 @@ QWasmWindow::QWasmWindow(QWindow *w, QWasmDeadKeySupport *deadKeySupport, QWasmClipboard::installEventHandlers(m_canvas); - // set inputmode to none to stop mobile keyboard opening + // set inputMode to none to stop mobile keyboard opening // when user clicks anywhere on the canvas. - m_canvas.set("inputmode", std::string("none")); + m_canvas.set("inputMode", std::string("none")); // Hide the canvas from screen readers. m_canvas.call<void>("setAttribute", std::string("aria-hidden"), std::string("true")); @@ -351,6 +351,8 @@ void QWasmWindow::raise() { bringToTop(); invalidate(); + if (QWasmIntegration::get()->inputContext()) + m_canvas.call<void>("focus"); } void QWasmWindow::lower() |