Implement text update in wasm apps during accessibility

Implementation for QAccessibleEditableTextInterface is pending for texts
in qml accessibility, adding accessibile role check for text to be
updated when accessibility feature is on in wasm

Change-Id: Ic24ebf6942e50a5952126e312afa633ed4fbe9ce
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
This commit is contained in:
Shreya Pattani 2023-07-25 10:19:05 +05:30
parent 5290ba4cbd
commit 6341e0d201

View File

@ -423,8 +423,11 @@ void QWasmAccessibility::handleEventFromHtmlElement(const emscripten::val event)
} else if (eventType == "input") {
if (iface->editableTextInterface()) {
std::string insertText = event["target"]["value"].as<std::string>();
// as EditableTextInterface is not implemented in qml accessibility
// so we need to check the role for text to update in the textbox during accessibility
if (iface->editableTextInterface() || iface->role() == QAccessible::EditableText) {
std::string insertText = event["target"]["value"].as<std::string>();
iface->setText(QAccessible::Value, QString::fromStdString(insertText));
}
}