* @setSelection: Sets the selection bounds of a textarea or input and focuses * the input. * -@input Set selection bounds of this input or textarea * -@offsets Object of same form that is returned from get*
(input, offsets)
| 6456 | * -@offsets Object of same form that is returned from get* |
| 6457 | */ |
| 6458 | function setSelection(input, offsets) { |
| 6459 | var start = offsets.start, |
| 6460 | end = offsets.end; |
| 6461 | |
| 6462 | if (end === undefined) { |
| 6463 | end = start; |
| 6464 | } |
| 6465 | |
| 6466 | if ('selectionStart' in input) { |
| 6467 | input.selectionStart = start; |
| 6468 | input.selectionEnd = Math.min(end, input.value.length); |
| 6469 | } else { |
| 6470 | setOffsets(input, offsets); |
| 6471 | } |
| 6472 | } |
| 6473 | |
| 6474 | var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11; |
| 6475 |
no test coverage detected