MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / setPickerValue

Function setPickerValue

javascript/atoms/typescript/type.ts:195–208  ·  view source on GitHub ↗
(input: HTMLInputElement, text: string)

Source from the content-addressed store, hash-verified

193// input stores hex digits in lower case, so "#FF0000" is accepted as
194// "#ff0000".
195function setPickerValue(input: HTMLInputElement, text: string): boolean {
196 const previous = input.value
197 const expected = input.type === 'color' ? text.toLowerCase() : text
198 input.value = text
199 if (input.value !== expected) {
200 input.value = previous
201 return false
202 }
203 if (previous !== expected) {
204 fire(input, EventType.INPUT, { inputType: 'insertReplacementText', data: null })
205 fire(input, EventType.CHANGE, undefined)
206 }
207 return true
208}
209
210export default type

Callers 1

typeFunction · 0.85

Calls 1

fireFunction · 0.85

Tested by

no test coverage detected