From c2679d0830de88cae142cbc2c134aff575681e94 Mon Sep 17 00:00:00 2001 From: Grand Julivan Date: Fri, 12 Apr 2024 03:32:11 +0200 Subject: [PATCH] Allow tabIndex to be passed into editor (#508) --- src/main/ts/components/Editor.tsx | 7 +++++-- src/main/ts/components/EditorPropTypes.ts | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/ts/components/Editor.tsx b/src/main/ts/components/Editor.tsx index ac57fa0b..407b89ee 100644 --- a/src/main/ts/components/Editor.tsx +++ b/src/main/ts/components/Editor.tsx @@ -19,6 +19,7 @@ export interface IProps { value: string; init: EditorOptions & Partial>; tagName: string; + tabIndex: number; cloudChannel: Version; plugins: NonNullable; toolbar: NonNullable; @@ -180,7 +181,8 @@ export class Editor extends React.Component { return React.createElement(tagName, { ref: this.elementRef, - id: this.id + id: this.id, + tabIndex: this.props.tabIndex }); } @@ -189,7 +191,8 @@ export class Editor extends React.Component { ref: this.elementRef, style: { visibility: 'hidden' }, name: this.props.textareaName, - id: this.id + id: this.id, + tabIndex: this.props.tabIndex }); } diff --git a/src/main/ts/components/EditorPropTypes.ts b/src/main/ts/components/EditorPropTypes.ts index c3475568..771f1ae3 100644 --- a/src/main/ts/components/EditorPropTypes.ts +++ b/src/main/ts/components/EditorPropTypes.ts @@ -96,6 +96,7 @@ export const EditorPropTypes: IEditorPropTypes = { onEditorChange: PropTypes.func, value: PropTypes.string, tagName: PropTypes.string, + tabIndex: PropTypes.number, cloudChannel: PropTypes.string, plugins: PropTypes.oneOfType([ PropTypes.string, PropTypes.array ]), toolbar: PropTypes.oneOfType([ PropTypes.string, PropTypes.array ]),