Merge remote-tracking branch 'remotes/origin/fix/webkit-focus-bug'
This commit is contained in:
commit
a06739af9a
1 changed files with 7 additions and 0 deletions
|
|
@ -102,6 +102,11 @@ var TextInput = function(parentNode, host) {
|
||||||
function resetSelection(isEmpty) {
|
function resetSelection(isEmpty) {
|
||||||
if (inComposition)
|
if (inComposition)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// this prevents infinite recursion on safari 8
|
||||||
|
// see https://github.com/ajaxorg/ace/issues/2114
|
||||||
|
inComposition = true;
|
||||||
|
|
||||||
if (inputHandler) {
|
if (inputHandler) {
|
||||||
selectionStart = 0;
|
selectionStart = 0;
|
||||||
selectionEnd = isEmpty ? 0 : text.value.length - 1;
|
selectionEnd = isEmpty ? 0 : text.value.length - 1;
|
||||||
|
|
@ -113,6 +118,8 @@ var TextInput = function(parentNode, host) {
|
||||||
try {
|
try {
|
||||||
text.setSelectionRange(selectionStart, selectionEnd);
|
text.setSelectionRange(selectionStart, selectionEnd);
|
||||||
} catch(e){}
|
} catch(e){}
|
||||||
|
|
||||||
|
inComposition = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetValue() {
|
function resetValue() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue