@ckeditor/ckeditor5-widget 0.0.0-nightly-20250828.0 → 0.0.0-nightly-20250829.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 +14 -3
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/utils.js +15 -3
package/dist/index.js
CHANGED
|
@@ -323,15 +323,26 @@ import { throttle } from 'es-toolkit/compat';
|
|
|
323
323
|
if (options.withAriaRole !== false) {
|
|
324
324
|
writer.setAttribute('role', 'textbox', editable);
|
|
325
325
|
}
|
|
326
|
-
|
|
326
|
+
// Setting tabindex=-1 on contenteditable=false makes it focusable. It propagates focus to the editable
|
|
327
|
+
// element and makes it possible to highlight nested editables as focused. It's not what we want
|
|
328
|
+
// for read-only editables though.
|
|
329
|
+
// See more: https://github.com/ckeditor/ckeditor5/issues/18965
|
|
330
|
+
if (!editable.isReadOnly) {
|
|
331
|
+
writer.setAttribute('tabindex', '-1', editable);
|
|
332
|
+
}
|
|
327
333
|
if (options.label) {
|
|
328
334
|
writer.setAttribute('aria-label', options.label, editable);
|
|
329
335
|
}
|
|
330
336
|
// Set initial contenteditable value.
|
|
331
337
|
writer.setAttribute('contenteditable', editable.isReadOnly ? 'false' : 'true', editable);
|
|
332
338
|
// Bind the contenteditable property to element#isReadOnly.
|
|
333
|
-
editable.on('change:isReadOnly', (evt, property,
|
|
334
|
-
writer.setAttribute('contenteditable',
|
|
339
|
+
editable.on('change:isReadOnly', (evt, property, isReadonly)=>{
|
|
340
|
+
writer.setAttribute('contenteditable', isReadonly ? 'false' : 'true', editable);
|
|
341
|
+
if (isReadonly) {
|
|
342
|
+
writer.removeAttribute('tabindex', editable);
|
|
343
|
+
} else {
|
|
344
|
+
writer.setAttribute('tabindex', '-1', editable);
|
|
345
|
+
}
|
|
335
346
|
});
|
|
336
347
|
editable.on('change:isFocused', (evt, property, is)=>{
|
|
337
348
|
if (is) {
|