add accessibility parameters

This commit is contained in:
Aran-Fey
2024-07-06 23:18:04 +02:00
parent 421a42be2f
commit f7edc80842
11 changed files with 74 additions and 22 deletions

View File

@@ -6,6 +6,7 @@ export type MultiLineTextInputState = ComponentState & {
_type_: 'MultiLineTextInput-builtin';
text?: string;
label?: string;
accessibility_label?: string;
is_sensitive?: boolean;
is_valid?: boolean;
};
@@ -17,7 +18,7 @@ export class MultiLineTextInputComponent extends ComponentBase {
createElement(): HTMLElement {
let textarea = document.createElement('textarea');
this.inputBox = new InputBox(this.id, { inputElement: textarea });
this.inputBox = new InputBox({ inputElement: textarea });
let element = this.inputBox.outerElement;
element.classList.add('rio-multi-line-text-input');
@@ -61,6 +62,10 @@ export class MultiLineTextInputComponent extends ComponentBase {
this.inputBox.label = deltaState.label;
}
if (deltaState.accessibility_label !== undefined) {
this.inputBox.accessibilityLabel = deltaState.accessibility_label;
}
if (deltaState.is_sensitive !== undefined) {
this.inputBox.isSensitive = deltaState.is_sensitive;
}