@ckeditor/ckeditor5-widget 0.0.0-nightly-20250324.0 → 0.0.0-nightly-20250326.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @ckeditor/ckeditor5-widget might be problematic. Click here for more details.
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/utils.d.ts +3 -0
- package/src/utils.js +6 -1
package/dist/index.js
CHANGED
@@ -278,6 +278,7 @@ import { throttle } from 'es-toolkit/compat';
|
|
278
278
|
* * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,
|
279
279
|
* * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.
|
280
280
|
* * implements the {@link ~setHighlightHandling view highlight on widget's editable}.
|
281
|
+
* * sets the `role` attribute to `textbox` for accessibility purposes.
|
281
282
|
*
|
282
283
|
* Similarly to {@link ~toWidget `toWidget()`} this function should be used in `editingDowncast` only and it is usually
|
283
284
|
* used together with {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
|
@@ -310,13 +311,17 @@ import { throttle } from 'es-toolkit/compat';
|
|
310
311
|
*
|
311
312
|
* @param options Additional options.
|
312
313
|
* @param options.label Editable's label used by assistive technologies (e.g. screen readers).
|
314
|
+
* @param options.withAriaRole Whether to add the role="textbox" attribute on the editable. Defaults to `true`.
|
313
315
|
* @returns Returns the same element that was provided in the `editable` parameter
|
314
316
|
*/ function toWidgetEditable(editable, writer, options = {}) {
|
315
317
|
writer.addClass([
|
316
318
|
'ck-editor__editable',
|
317
319
|
'ck-editor__nested-editable'
|
318
320
|
], editable);
|
319
|
-
|
321
|
+
// Set role="textbox" only if explicitly requested (defaults to true for backward compatibility).
|
322
|
+
if (options.withAriaRole !== false) {
|
323
|
+
writer.setAttribute('role', 'textbox', editable);
|
324
|
+
}
|
320
325
|
writer.setAttribute('tabindex', '-1', editable);
|
321
326
|
if (options.label) {
|
322
327
|
writer.setAttribute('aria-label', options.label, editable);
|