I'm working on a html editor (contenteditable div) and came across this issue:
double (or triple) clicking on empty lines like <div><span><br></span></div> behaves differently in safari/chrome and firefox. In safari and chrome the empty lines get highlighted and selected. this is what I expect. but in firefox the caret dissappears and range.startcontainer is the container div (the contenteditable) instead of the empty line. firefox doesn't highlight the span/empty line, I'm OK with that, but I would like to change the behaviour to act like a single click (caret stays in place and range.startcontainer is <span>.
You may ask what I want to to with empty lines. I've made some functions for styling options (change to list/bullet points for example) that should be accessible even when double clicking on the empty line.
I've tried to solve this by saving the start node on the first click and then restore it when the users clicks 2 or more times and bring the caret back by collapsing the range. but I guess there's a better/cleaner solution since it's only needed for ff.
any ideas appreciated!