diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2023-02-03 12:59:42 +0100 |
---|---|---|
committer | Morten Sørvig <morten.sorvig@qt.io> | 2023-02-03 18:42:21 +0100 |
commit | 2443f2be07607e44ec483278873702eb0f57ab26 (patch) | |
tree | bbcb961ef744646010a23ccb2e264de7c2978c01 /src/plugins/platforms/wasm/qwasmclipboard.cpp | |
parent | 43a77d4b64608edee3782ddbe15da2364b24567e (diff) |
wasm: set contenteditable on canvas
We don't want to make the top-level screen contenteditable,
since that interferes with accessibility. Instead, make
the canvas contenteditable and install clipboard event
handlers there.
Also move follow-up settings which counters some of the
effects contenteditable (outline: none and inputmode: none),
and move aria-hidden.
Pick-to: 6.5
Change-Id: Ibe73d8d097acd948ba8920c781a2003db0a14f3d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmclipboard.cpp')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmclipboard.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/wasm/qwasmclipboard.cpp b/src/plugins/platforms/wasm/qwasmclipboard.cpp index 215ff50aa0..df54a47ea9 100644 --- a/src/plugins/platforms/wasm/qwasmclipboard.cpp +++ b/src/plugins/platforms/wasm/qwasmclipboard.cpp @@ -173,15 +173,15 @@ void QWasmClipboard::initClipboardPermissions() })()); } -void QWasmClipboard::installEventHandlers(const emscripten::val &screenElement) +void QWasmClipboard::installEventHandlers(const emscripten::val &target) { emscripten::val cContext = val::undefined(); emscripten::val isChromium = val::global("window")["chrome"]; - if (!isChromium.isUndefined()) { + if (!isChromium.isUndefined()) { cContext = val::global("document"); - } else { - cContext = screenElement; - } + } else { + cContext = target; + } // Fallback path for browsers which do not support direct clipboard access cContext.call<void>("addEventListener", val("cut"), val::module_property("qtClipboardCutTo"), true); |