'Fix' the caret position when quoting on Opera. Changelog.

This commit is contained in:
Nicolas Stepien 2012-06-14 22:35:43 +02:00
parent 07ada39342
commit 4f8cfa82d8
3 changed files with 8 additions and 0 deletions

View File

@ -1570,6 +1570,9 @@
ta.value = ta.value.slice(0, caretPos) + text + ta.value.slice(ta.selectionEnd);
ta.focus();
range = caretPos + text.length;
if ($.engine === 'presto') {
range++;
}
ta.setSelectionRange(range, range);
e = d.createEvent('Event');
e.initEvent('input', true, false);

View File

@ -1,4 +1,7 @@
master
- Mayhem
Opera fixes.
/f/ fixes.
2.32.1
- Mayhem

View File

@ -1155,6 +1155,8 @@ QR =
ta.focus()
# Move the caret to the end of the new quote.
range = caretPos + text.length
# XXX Opera counts newlines as double
range++ if $.engine is 'presto'
ta.setSelectionRange range, range
# Fire the 'input' event