0

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

Paul
  • 1
  • 1
  • Update. I thought that it's my problem, but I found qt html editor example and they have the same issue. If somebody interested you can download it from [gitorious](http://qt.gitorious.org/qt-labs/graphics-dojo/trees/master/htmleditor) and try. For repeat bug find there "strikethrough", put cursor after it and press space – Paul Jun 19 '13 at 02:31
  • Well, I fixed this bug by reimplementing select behavior using javascript, but maybe somebody know better solution? – Paul Jun 19 '13 at 21:34

0 Answers0