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 <lorn.potter@gmail.com>
Reviewed-by: Inho Lee <inho.lee@qt.io>
(cherry picked from commit 59645a409b4b2a68a329b61d7e5837b6fd651a48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Morten Sørvig 2024-07-23 16:15:44 +02:00 committed by Qt Cherry-pick Bot
parent 305880fcda
commit 00a1bdfbe1

View File

@ -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);