From bcbe7e23357c9ef15e82c36a7518fb27edd35660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Fri, 6 Sep 2024 15:09:04 +0200 Subject: wasm: don't set contentEditable on the canvas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The canvas is aria-hidden, and should not take focus or handle events. Move this to the window contents element. Task-number: QTBUG-128732 Change-Id: I54453d067570b9e2c9db9c7293f267f4cfc0aacd Reviewed-by: Piotr Wierciński Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/wasm/qwasmwindow.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/plugins/platforms/wasm/qwasmwindow.cpp') diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp index 7b85e31c249..ba325bac121 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.cpp +++ b/src/plugins/platforms/wasm/qwasmwindow.cpp @@ -74,16 +74,16 @@ QWasmWindow::QWasmWindow(QWindow *w, QWasmDeadKeySupport *deadKeySupport, m_canvas["classList"].call("add", emscripten::val("qt-window-canvas")); - // Set contenteditable so that the canvas gets clipboard events, + // Set contentEditable so that the window gets clipboard events, // then hide the resulting focus frame. - m_canvas.set("contentEditable", std::string("true")); - m_canvas["style"].set("outline", std::string("none")); + m_windowContents.set("contentEditable", std::string("true")); + m_windowContents["style"].set("outline", std::string("none")); - QWasmClipboard::installEventHandlers(m_canvas); + QWasmClipboard::installEventHandlers(m_windowContents); - // set inputMode to none to stop mobile keyboard opening - // when user clicks anywhere on the canvas. - m_canvas.set("inputMode", std::string("none")); + // Set inputMode to none to stop the mobile keyboard from opening + // when the user clicks on the window. + m_windowContents.set("inputMode", std::string("none")); // Hide the canvas from screen readers. m_canvas.call("setAttribute", std::string("aria-hidden"), std::string("true")); -- cgit v1.2.3