0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Wired up top-of-document handling in Lexical editor

closes https://github.com/TryGhost/Team/issues/2285

- added passthrough of `cursorDidExitAtTop` action so the editor can trigger title input focus on key commands that trigger the cursor to leave the top of document
This commit is contained in:
Kevin Ansfield 2022-12-01 16:46:00 +00:00
parent a51f3a124d
commit a855973ac6
2 changed files with 8 additions and 2 deletions

View file

@ -40,6 +40,7 @@
@lexical={{@body}}
@onChange={{@onBodyChange}}
@registerAPI={{this.registerEditorAPI}}
@cursorDidExitAtTop={{this.focusTitle}}
/>
{{!-- <KoenigEditor

View file

@ -149,8 +149,13 @@ export default class KoenigLexicalEditor extends Component {
<KoenigComposer
initialEditorState={this.args.lexical}
onError={this.onError}
imageUploadFunction={{imageUploader, uploadProgress}} >
<KoenigEditor onChange={this.args.onChange} registerAPI={this.args.registerAPI} />
imageUploadFunction={{imageUploader, uploadProgress}}
>
<KoenigEditor
onChange={this.args.onChange}
registerAPI={this.args.registerAPI}
cursorDidExitAtTop={this.args.cursorDidExitAtTop}
/>
</KoenigComposer>
</Suspense>
</ErrorHandler>