Opened 11 years ago
Last modified 9 years ago
#12634 confirmed Bug
Impossible to place caret in empty inline style that existed in an empty block — at Version 1
Reported by: | Piotrek Koszuliński | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Selection | Version: | 3.0 |
Keywords: | IBM | Cc: | satya_minnekanti@… |
Description (last modified by )
- Open any sample.
- Clean the contents.
- Press the bold button and type something.
- Press enter multiple times. Notice that the bold style is preserved.
- Start pressing up arrow or clicking in the empty paragraphs.
- Notice that bold is gone.
- Check the DOM - strong elements are still there.
There are two solutions possible:
- Put bogus <br> inside empty inline elements. Then, I think that browsers will place the caret inside empty blocks by themselves.
- Handle this on keyup and mouseup events. Check whether collapsed selection was placed next to empty inline element in an empty line and fix the selection.
BTW. Note that pressing the bold button again after navigating to the empty line will create another strong tag. This is due to #12633.