summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmclipboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmclipboard.cpp')
-rw-r--r--src/plugins/platforms/wasm/qwasmclipboard.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/platforms/wasm/qwasmclipboard.cpp b/src/plugins/platforms/wasm/qwasmclipboard.cpp
index e5392f33cd7..ff681398315 100644
--- a/src/plugins/platforms/wasm/qwasmclipboard.cpp
+++ b/src/plugins/platforms/wasm/qwasmclipboard.cpp
@@ -86,6 +86,20 @@ void QWasmClipboard::paste(val event)
QWasmIntegration::get()->getWasmClipboard()->sendClipboardData(event);
}
+void QWasmClipboard::beforeInput(emscripten::val event)
+{
+ event.call<void>("preventDefault");
+ event.call<void>("stopPropagation");
+}
+
+void QWasmClipboard::input(emscripten::val event)
+{
+ event.call<void>("preventDefault");
+ event.call<void>("stopPropagation");
+ event["target"].set("innerHTML", std::string());
+ event["target"].set("value", std::string());
+}
+
QWasmClipboard::QWasmClipboard()
{
val clipboard = val::global("navigator")["clipboard"];