MCPcopy
hub / github.com/codeceptjs/CodeceptJS / selectAllInEditable

Function selectAllInEditable

lib/helper/extras/richTextEditor.js:102–111  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

100}
101
102function selectAllInEditable(el) {
103 const doc = el.ownerDocument
104 const win = doc.defaultView
105 el.focus()
106 const range = doc.createRange()
107 range.selectNodeContents(el)
108 const sel = win.getSelection()
109 sel.removeAllRanges()
110 sel.addRange(range)
111}
112
113function unmarkAll(marker) {
114 document.querySelectorAll('[' + marker + ']').forEach(n => n.removeAttribute(marker))

Callers

nothing calls this directly

Calls 1

focusMethod · 0.45

Tested by

no test coverage detected