Skip to content
\n
    \n
  1. Or you can just use Angular's keydown.enter
  2. \n
\n
<tui-editor [formControl]=\"control\" (keydown.enter)=\"method()\" />
","upvoteCount":0,"url":"https://github.com/orgs/taiga-family/discussions/9938#discussioncomment-11517645"}}}

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