Ctrl/Command+a will select trailingBreak when editor is empty

trailing-node-issue_ (1)

I’m using prosemirror offical demo. you can reproduce it here. And I can also reproduce it in latest beta version of tiptap2. The <br/> element is created by addHackNode logical source code here.

I m try to set css on br.trailing-breaknode by display: none. I find it can work out fix ctrl-a/command-a case, but it will cause new problem. the default enter shortcutkey will not play newline behavior anymore. My final solution only set <br/> in display: none when the editor content is empty.

I m very curious why in the chrome environment need the addHackNode any offical docs metion about this? And it seems all newline behaviour deep require <br/>.

Why is this (selecting that node) a problem?

User don’t typing anything. so ctrl-a/command-a should select nothing. I checked the editor.view is empty state and selection also is empty. It’s seems like browser selection state not sync with pm.

If you copy such a selection you get an empty clipboard. What is the actual user-visible problem with this?

I did select and press ctrl-c and paste it on pm, the editor dom don’t upsert the selected trailingBreak.

I m try to add keydown event listener to prevent when editor state is empty, ctrl+a/command+a will not trigger anymore. But it just fix in my case. if user changed the keyboard map, user still could trigger select behavior. Is there any other integration solution to resolve this scenarios?