Add Accessibility for TipTap RTE input fields (#20157)
* Add Accessibility for RTE input fields * add localization key for EN * Adds `aria-required` attribute --------- Co-authored-by: Oskar kruger <obk@umbraco.dk> Co-authored-by: leekelleher <leekelleher@gmail.com>
This commit is contained in:
@@ -2774,6 +2774,7 @@ export default {
|
||||
wordWrapConfigDescription: 'Enable word wrapping in the code editor.',
|
||||
},
|
||||
rte: {
|
||||
label: 'Rich Text Editor',
|
||||
config_blocks: 'Available Blocks',
|
||||
config_blocks_description: 'Define the available blocks.',
|
||||
config_ignoreUserStartNodes: 'Ignore User Start Nodes',
|
||||
|
||||
@@ -173,7 +173,12 @@ export class UmbInputTiptapElement extends UmbFormControlMixin<string, typeof Um
|
||||
this._editor = new Editor({
|
||||
element: element,
|
||||
editable: !this.readonly,
|
||||
editorProps: { attributes: { 'aria-label': this.label ?? 'Rich Text Editor' } },
|
||||
editorProps: {
|
||||
attributes: {
|
||||
'aria-label': this.label || this.localize.term('rte_label'),
|
||||
'aria-required': this.required ? 'true' : 'false',
|
||||
},
|
||||
},
|
||||
extensions: tiptapExtensions,
|
||||
content: this.#value,
|
||||
injectCSS: false, // Prevents injecting CSS into `window.document`, as it never applies to the shadow DOM. [LK]
|
||||
|
||||
Reference in New Issue
Block a user