I have searched for a way to change the default behavior for Enter to be the same as Shift + Enter.
To get
instead of new
Is it possible to change to this behavior somehow?
@agentq15 You're welcome :)
import { Editor, EditorContent, EditorMenuBar, Extension } from 'tiptap'
import { HardBreak } from 'tiptap-extensions'
...
editor = new Editor({
extensions: [
new HardBreak(),
new class extends Extension {
keys() {
return {
Enter(state, dispatch, view) {
const { schema, doc, tr } = view.state
const hard_break = schema.nodes.hard_break
const transaction = tr.replaceSelectionWith(hard_break.create()).scrollIntoView()
view.dispatch(transaction)
return true
}
}
}
}(),
],
content: '',
...
@MarvinMiles Thank you so much! Works like a charm!
@MarvinMiles Thank you! Works great!
Most helpful comment
@agentq15 You're welcome :)