Fix attributes not applied

This commit is contained in:
Leilei332 2025-11-29 08:42:18 +08:00
parent 48d7a30470
commit b287502383
2 changed files with 5 additions and 6 deletions

View file

@ -58,12 +58,10 @@ function SimpleEngine(options) {
if(this.widget.role) { if(this.widget.role) {
this.domNode.setAttribute("role",this.widget.role); this.domNode.setAttribute("role",this.widget.role);
} }
if(this.widget["aria-autocomplete"]) { this.widget.assignAttributes(this.domNode,{
this.domNode.setAttribute("aria-autocomplete",this.widget["aria-autocomplete"]); sourcePrefix: "aria-",
} destPrefix: "aria-"
if(this.widget["aria-controls"]) { });
this.domNode.setAttribute("aria-autocomplete",this.widget["aria-controls"]);
}
// Add an input event handler // Add an input event handler
$tw.utils.addEventListeners(this.domNode,[ $tw.utils.addEventListeners(this.domNode,[
{name: "focus", handlerObject: this, handlerMethod: "handleFocusEvent"}, {name: "focus", handlerObject: this, handlerMethod: "handleFocusEvent"},

View file

@ -184,6 +184,7 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
this.editInputActions = this.getAttribute("inputActions"); this.editInputActions = this.getAttribute("inputActions");
this.editRefreshTitle = this.getAttribute("refreshTitle"); this.editRefreshTitle = this.getAttribute("refreshTitle");
this.editAutoComplete = this.getAttribute("autocomplete"); this.editAutoComplete = this.getAttribute("autocomplete");
this.role = this.getAttribute("role");
this.isDisabled = this.getAttribute("disabled","no"); this.isDisabled = this.getAttribute("disabled","no");
this.isFileDropEnabled = this.getAttribute("fileDrop","no") === "yes"; this.isFileDropEnabled = this.getAttribute("fileDrop","no") === "yes";
// Get the default editor element tag and type // Get the default editor element tag and type