Skip to content

Commit

Permalink
Only prevent re-focusing of textarea on mobile platform
Browse files Browse the repository at this point in the history
Re-focusing is harmless on desktop browsers, and helps paper over
some browser bugs (such as firefox not 'really' focusing a textarea
in an iframe when the textarea is focused before the frame gains focus)
  • Loading branch information
marijnh committed Jan 30, 2013
1 parent 0b155e2 commit d3a97e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ window.CodeMirror = (function() {
}

function focusInput(cm) {
if (cm.options.readOnly != "nocursor" && (ie || document.activeElement != cm.display.input))
if (cm.options.readOnly != "nocursor" && (!mobile || document.activeElement != cm.display.input))
cm.display.input.focus();
}

Expand Down

0 comments on commit d3a97e0

Please sign in to comment.