Open adamwiggins opened 8 years ago
See replication steps for #26 (i.e., contenteditable is still weird)
Original p
tag is not preserved, making this fairly hard to solve with a validation rule.
Alternative is to short circuit any delete operations and trim the selection by -1 if
The foregoing idea is possibly worth a shot but reeks of unintended consequences.
So, I have to try to replicate this issue to encounter it. I.e., I have to select the text and then press shift
+right arrow
.
Is anyone getting this error with standard delete operations?
cc @adamwiggins @luciasantamaria
@brettimus To replicate: Put cursor before 'Live coding'. Hold Shift, press down arrow 3 times to select until end of 'Prose Editor'. Press delete. Then 'Navigate... ' gets Header style.
:+1: thanks!
As of now it’s feeling like we’re bumping into contenteditable weirdness.
I’m not sure mediumeditor gives us enough control over editor contents to fix this. The medium selection API is returning unexpected results when I try debugging in the middle of replicating. :confounded:
Underlying conditions that cause this bug seem to be that
window.getSelection().toString()
returns text with a trailing newline, andwindow.getSelection().focusNode
is a p
tag that is not visibly included in the user's selection. The focusNode
is the node in which the selection ends.
Steps to reproduce: