Readonly editor disable tabindex

This commit is contained in:
Gregory Schier
2023-04-13 22:36:11 -07:00
parent c1ac67cc31
commit 4a5b1f4da3

View File

@@ -233,7 +233,9 @@ function getExtensions({
keymap.of(singleLine ? defaultKeymap.filter((k) => k.key !== 'Enter') : defaultKeymap),
...(singleLine ? [singleLineExt()] : []),
...(!singleLine ? [multiLineExtensions] : []),
...(readOnly ? [EditorState.readOnly.of(true)] : []),
...(readOnly
? [EditorState.readOnly.of(true), EditorView.contentAttributes.of({ tabindex: '-1' })]
: []),
...(singleLine
? [
EditorView.domEventHandlers({