* @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)
| 6577 | * -@offsets Object of same form that is returned from get* |
| 6578 | */ |
| 6579 | function setSelection(input, offsets) { |
| 6580 | var start = offsets.start, |
| 6581 | end = offsets.end; |
| 6582 | |
| 6583 | if (end === undefined) { |
| 6584 | end = start; |
| 6585 | } |
| 6586 | |
| 6587 | if ('selectionStart' in input) { |
| 6588 | input.selectionStart = start; |
| 6589 | input.selectionEnd = Math.min(end, input.value.length); |
| 6590 | } else { |
| 6591 | setOffsets(input, offsets); |
| 6592 | } |
| 6593 | } |
| 6594 | |
| 6595 | var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11; |
| 6596 |
no test coverage detected