Add Aria support to edittext widget

This commit is contained in:
Leilei332 2025-11-28 21:33:29 +08:00
parent 4c27c09b4d
commit 6a48032961

View file

@ -55,6 +55,15 @@ function SimpleEngine(options) {
if(this.widget.isDisabled === "yes") {
this.domNode.setAttribute("disabled",true);
}
if(this.widget.role) {
this.domNode.setAttribute("role",this.widget.role);
}
if(this.widget["aria-autocomplete"]) {
this.domNode.setAttribute("aria-autocomplete",this.widget["aria-autocomplete"]);
}
if(this.widget["aria-controls"]) {
this.domNode.setAttribute("aria-autocomplete",this.widget["aria-controls"]);
}
// Add an input event handler
$tw.utils.addEventListeners(this.domNode,[
{name: "focus", handlerObject: this, handlerMethod: "handleFocusEvent"},