Skip to content

Commit b5cd2f4

Browse files
committed
allow string as localized blur info
1 parent 54f8078 commit b5cd2f4

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1111
- `<CodeEditor />`
1212
- documents the built-in Escape then Tab sequence for moving focus out of the editor when Tab is configured to indent
1313
- shows a compact keyboard navigation hint in a bottom CodeMirror panel when Tab is configured to indent
14-
- `keyboardHint` accepts a custom element for localized instructions, including its `lang` attribute; the default instruction is marked as English
14+
- `keyboardHint` accepts a custom string or element for localized instructions, the default instruction is marked as English
1515
- `<Switch />`
1616
- `noDrag` parameter: Add the `nodrag` class to the Switch element. Default: `true`
1717
- `<Markdown />`

‎src/extensions/codemirror/CodeMirror.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ export interface CodeEditorProps
188188
translate?: (key: string) => string | false;
189189
/**
190190
* Custom keyboard navigation hint shown in the bottom panel.
191-
* Set `lang` on the element if its language differs from the surrounding page.
191+
* Set `lang` on a wrapping `span` if its language differs from the surrounding page.
192192
* Defaults to an English instruction for leaving the editor with Escape then Tab.
193193
*/
194-
keyboardHint?: React.ReactElement;
194+
keyboardHint?: React.ReactElement | string;
195195
}
196196

197197
const DEFAULT_BLUR_HINT = "Press Escape then Tab to leave the editor.";

0 commit comments

Comments
 (0)