Skip to content

Switch default enter behavior of editor. #9938

Answered by splincode
mateen777 asked this question in Q&A
Discussion options

You must be logged in to vote

@mateen777

  1. You can use ProseMirror options: https://taiga-family.github.io/editor/options#editor-props
{
            provide: TUI_EDITOR_OPTIONS,
            deps: [TuiAlertService],
            useFactory(alerts: TuiAlertService): TuiEditorOptions {
                return {
                    ...TUI_EDITOR_DEFAULT_OPTIONS,
                    editorProps: {
                        handleDOMEvents: {
                            keydown: (_, event: KeyboardEvent) => {
                                if (event.key === 'Enter' && !event.shiftKey) {
                                    alerts
                                        .open('Enter <strong>pressed</strong>')

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mateen777
Comment options

@splincode
Comment options

@splincode
Comment options

Answer selected by splincode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants