Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issue(#6246) #6247

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/edit/mouse_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,14 @@ function leftButtonStartDrag(cm, event, pos, behavior) {
e_preventDefault(e)
if (!behavior.addNew)
extendSelection(cm.doc, pos, null, null, behavior.extend)
// Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
if (webkit || ie && ie_version == 9)
// 'webkit' will cause issue(#6246)
let isEdit = false
if (webkit) {
isEdit = display.wrapper.ownerDocument.body.getAttribute('contenteditable')
isEdit = isEdit === '' || /^true$/i.test(isEdit)
}
// Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
if ((!isEdit && webkit) || ie && ie_version == 9)
setTimeout(() => {display.wrapper.ownerDocument.body.focus(); display.input.focus()}, 20)
else
display.input.focus()
Expand Down