Skip to content
Snippets Groups Projects
Commit df00f3fc authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

Fix bad input reading after a cx menu copy + unfocus

Closes #4569
parent 76278ea6
No related branches found
No related tags found
No related merge requests found
......@@ -326,10 +326,14 @@ export default class TextareaInput {
if (!ie || (ie && ie_version < 9)) prepareSelectAllHack()
let i = 0, poll = () => {
if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&
te.selectionEnd > 0 && input.prevInput == "\u200b")
te.selectionEnd > 0 && input.prevInput == "\u200b") {
operation(cm, selectAll)(cm)
else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500)
else display.input.reset()
} else if (i++ < 10) {
display.detectingSelectAll = setTimeout(poll, 500)
} else {
display.selForContextMenu = null
display.input.reset()
}
}
display.detectingSelectAll = setTimeout(poll, 200)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment