In useMultiRootEditor.tsx the editable elements are created with a call to
editable = ui.view.createEditable( rootName, innerRef.current );
This API can actually take 3 parameters:
Parameters:
-
editableName : string
The name for the editable.
-
[ editableElement ] : HTMLElement
DOM element for which the editable should be created.
-
[ label ] : string
The accessible editable label used by assistive technologies.
The above call should be updated so it passes in the label element. This would need to be passed as a property from the code that sets up the editableElements array
const editableElements = roots.map(
rootName => (
<EditorEditable
key={rootName}
id={rootName}
rootName={rootName}
semaphore={semaphore}
label={label} //proposed new property to pass label
/>
)
);
So ideally when creating a root we can specify some additional config (the label)
I setup my root with a call to
editor.addRoot(id, {
data: getIn(getFieldMeta.current().value, id),
isUndoable: false,
config: { //proposed new property to pass the label
label:'My Label'
}
});
If this were extended to allow an optional label to be specified, that would be very useful.
In
useMultiRootEditor.tsxthe editable elements are created with a call toThis API can actually take 3 parameters:
Parameters:
editableName : string
The name for the editable.
[ editableElement ] : HTMLElement
DOM element for which the editable should be created.
[ label ] : string
The accessible editable label used by assistive technologies.
The above call should be updated so it passes in the
labelelement. This would need to be passed as a property from the code that sets up theeditableElementsarraySo ideally when creating a
rootwe can specify some additional config (the label)I setup my root with a call to
If this were extended to allow an optional
labelto be specified, that would be very useful.