I tried to google this question, but google don't know about this issue. I'm using Qt 4.8.1 QtWebkit 2.2.3+Javascript for implement some kind of Html-Editor. It is hard to explain the problem by text so I maid some screenshots (link in the end of message).
1) So at first I insert just normal text.
2) After I add one more word, and wrap it in tag using this javascript function
function misspelledWord(id) { var sel = rangy.getSelection(); var highlightDiv = document.createElement('span'); highlightDiv.className = "misspelled"; highlightDiv.id = "misspelled_" + id; range.surroundContents( highlightDiv ); var space = document.createTextNode("\xa0"); highlightDiv.parentNode.insertBefore(space, highlightDiv.nextSibling); range.setStartAfter(space); range.setEndAfter(space); sel.removeAllRanges(); sel.setSingleRange(range); }
3) After I press space one more time. Webkit select all text till "span" by itself and I can not delete this selection, only if select it by hand one more time.
https://i.stack.imgur.com/PprG0.png - screenshots
So maybe somebody know how to fix this behavior?
Best regards
Paul