Skip to content

Commit

Permalink
CodeMirror: Force inputStyle to be "textarea"
Browse files Browse the repository at this point in the history
As of version 5.8, CodeMirror defaults inputStyle to
"contenteditable" on mobile browsers. With that, CodeMirror
grabs focus every time one tries to write an inline comment,
making the commenting functionality unusable on mobile.

There might be some upstream issue involved, but for now let's
just set inputStyle to "textarea" as CodeMirror already does on
desktop browsers. This will make commenting usable on mobile
again.

Change-Id: I278d6bfc671e77f9a02d21b2894649e0d9885a5c
  • Loading branch information
Dominator008 committed Mar 16, 2016
1 parent 2545752 commit 44679ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ CodeMirror newCm(
return CodeMirror.create(parent, Configuration.create()
.set("cursorBlinkRate", prefs.cursorBlinkRate())
.set("cursorHeight", 0.85)
.set("inputStyle", "textarea")
.set("keyMap", "vim_ro")
.set("lineNumbers", prefs.showLineNumbers())
.set("lineWrapping", false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ CodeMirror newCm(
.set("cursorBlinkRate", prefs.cursorBlinkRate())
.set("cursorHeight", 0.85)
.set("gutters", gutters)
.set("inputStyle", "textarea")
.set("keyMap", "vim_ro")
.set("lineNumbers", false)
.set("lineWrapping", false)
Expand Down

0 comments on commit 44679ef

Please sign in to comment.