MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / reset

Method reset

lib/web/CodeMirror/src/input/TextareaInput.js:160–173  ·  view source on GitHub ↗
(typing)

Source from the content-addressed store, hash-verified

158 // Reset the input to correspond to the selection (or to be empty,
159 // when not typing and nothing is selected)
160 reset(typing) {
161 if (this.contextMenuPending || this.composing) return
162 let cm = this.cm
163 if (cm.somethingSelected()) {
164 this.prevInput = ""
165 let content = cm.getSelection()
166 this.textarea.value = content
167 if (cm.state.focused) selectInput(this.textarea)
168 if (ie && ie_version >= 9) this.hasSelection = content
169 } else if (!typing) {
170 this.prevInput = this.textarea.value = ""
171 if (ie && ie_version >= 9) this.hasSelection = null
172 }
173 }
174
175 getField() { return this.textarea }
176

Callers 2

pollMethod · 0.95
readOnlyChangedMethod · 0.95

Calls 3

selectInputFunction · 0.90
somethingSelectedMethod · 0.80
getSelectionMethod · 0.80

Tested by

no test coverage detected