(cm, e)
| 19 | } |
| 20 | |
| 21 | export function onFocus(cm, e) { |
| 22 | if (cm.state.delayingBlurEvent && !cm.state.draggingText) cm.state.delayingBlurEvent = false |
| 23 | |
| 24 | if (cm.options.readOnly == "nocursor") return |
| 25 | if (!cm.state.focused) { |
| 26 | signal(cm, "focus", cm, e) |
| 27 | cm.state.focused = true |
| 28 | addClass(cm.display.wrapper, "CodeMirror-focused") |
| 29 | // This test prevents this from firing when a context |
| 30 | // menu is closed (since the input reset would kill the |
| 31 | // select-all detection hack) |
| 32 | if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { |
| 33 | cm.display.input.reset() |
| 34 | if (webkit) setTimeout(() => cm.display.input.reset(true), 20) // Issue #1730 |
| 35 | } |
| 36 | cm.display.input.receivedFocus() |
| 37 | } |
| 38 | restartBlink(cm) |
| 39 | } |
| 40 | export function onBlur(cm, e) { |
| 41 | if (cm.state.delayingBlurEvent) return |
| 42 |
no test coverage detected