From 00a1bdfbe1c44e3365c155f65a7707bda8f50bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Tue, 23 Jul 2024 16:15:44 +0200 Subject: [PATCH] wasm: set input element position on startup Follow-up from commit c844a7a5. The input element was taking up space on the html body, and was offsetting the Qt app content, making it partly invisible. The element already has position: "absolute" which should remove it from the layout, but it looks like it needs to have a set position as well on some browser for that to happen. Pick-to: 6.7 Change-Id: I618d2561eb32e181797034d0b3005d716d4f6136 Reviewed-by: Lorn Potter Reviewed-by: Inho Lee (cherry picked from commit 59645a409b4b2a68a329b61d7e5837b6fd651a48) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/wasm/qwasminputcontext.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/wasm/qwasminputcontext.cpp b/src/plugins/platforms/wasm/qwasminputcontext.cpp index f8dbd86a193..3c87e244a09 100644 --- a/src/plugins/platforms/wasm/qwasminputcontext.cpp +++ b/src/plugins/platforms/wasm/qwasminputcontext.cpp @@ -252,6 +252,8 @@ QWasmInputContext::QWasmInputContext() m_inputElement.set("contenteditable","true"); m_inputElement["style"].set("position", "absolute"); + m_inputElement["style"].set("left", 0); + m_inputElement["style"].set("top", 0); m_inputElement["style"].set("opacity", 0); m_inputElement["style"].set("display", ""); m_inputElement["style"].set("z-index", -2);