* @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)
| 6676 | * -@offsets Object of same form that is returned from get* |
| 6677 | */ |
| 6678 | function setSelection(input, offsets) { |
| 6679 | var start = offsets.start, |
| 6680 | end = offsets.end; |
| 6681 | |
| 6682 | if (end === undefined) { |
| 6683 | end = start; |
| 6684 | } |
| 6685 | |
| 6686 | if ('selectionStart' in input) { |
| 6687 | input.selectionStart = start; |
| 6688 | input.selectionEnd = Math.min(end, input.value.length); |
| 6689 | } else { |
| 6690 | setOffsets(input, offsets); |
| 6691 | } |
| 6692 | } |
| 6693 | |
| 6694 | var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11; |
| 6695 |
no test coverage detected