Skip to content

Commit c2679d0

Browse files
authored
Allow tabIndex to be passed into editor (#508)
1 parent adb4a7d commit c2679d0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/ts/components/Editor.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export interface IProps {
1919
value: string;
2020
init: EditorOptions & Partial<Record<'selector' | 'target' | 'readonly' | 'license_key', undefined>>;
2121
tagName: string;
22+
tabIndex: number;
2223
cloudChannel: Version;
2324
plugins: NonNullable<EditorOptions['plugins']>;
2425
toolbar: NonNullable<EditorOptions['toolbar']>;
@@ -180,7 +181,8 @@ export class Editor extends React.Component<IAllProps> {
180181

181182
return React.createElement(tagName, {
182183
ref: this.elementRef,
183-
id: this.id
184+
id: this.id,
185+
tabIndex: this.props.tabIndex
184186
});
185187
}
186188

@@ -189,7 +191,8 @@ export class Editor extends React.Component<IAllProps> {
189191
ref: this.elementRef,
190192
style: { visibility: 'hidden' },
191193
name: this.props.textareaName,
192-
id: this.id
194+
id: this.id,
195+
tabIndex: this.props.tabIndex
193196
});
194197
}
195198

src/main/ts/components/EditorPropTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export const EditorPropTypes: IEditorPropTypes = {
9696
onEditorChange: PropTypes.func,
9797
value: PropTypes.string,
9898
tagName: PropTypes.string,
99+
tabIndex: PropTypes.number,
99100
cloudChannel: PropTypes.string,
100101
plugins: PropTypes.oneOfType([ PropTypes.string, PropTypes.array ]),
101102
toolbar: PropTypes.oneOfType([ PropTypes.string, PropTypes.array ]),

0 commit comments

Comments
 (0)