You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a custom AnswerBox type node view that I want to create. I have described its schema as paragraph taskList where paragraph represents the question and taskList represents the options. But I'm struggling with correctly defining what happens when user presses Enter and Backspace.
Enter:
When user presses Enter on an empty taskItem, the cursor should exit the node and go to a new line. This happens with a regular taskList but not with my custom node view for some reason. I have gone through the source code of taskList and taskItem but couldn't find anything related.
I have weird behaviour on Backspace on the first paragraph. What I want to happen is for the node to delete itself when Backspace is pressed in an empty paragraph but it deletes the node instead above it instead!!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a custom AnswerBox type node view that I want to create. I have described its schema as
paragraph taskList
whereparagraph
represents the question andtaskList
represents the options. But I'm struggling with correctly defining what happens when user presses Enter and Backspace.Enter:
When user presses Enter on an empty
taskItem
, the cursor should exit the node and go to a new line. This happens with a regulartaskList
but not with my custom node view for some reason. I have gone through the source code oftaskList
andtaskItem
but couldn't find anything related.See https://codesandbox.io/p/sandbox/friendly-hawking-56fxvl
Regular
taskList
:Screen.Recording.2024-09-25.203409.mp4
My custom node view:
Screen.Recording.2024-09-25.203639.mp4
Backspace :
I have weird behaviour on Backspace on the first
paragraph
. What I want to happen is for the node to delete itself when Backspace is pressed in an emptyparagraph
but it deletes the node instead above it instead!!Screen.Recording.2024-09-25.204250.mp4
See https://codesandbox.io/p/sandbox/friendly-hawking-56fxvl
What is the best way to define these behaviours? I've looked through the documentation but couldn't find anything.
Beta Was this translation helpful? Give feedback.
All reactions