* @getSelection: Gets the selection bounds of a focused textarea, input or * contentEditable node. * -@input: Look up selection bounds of this input * -@return {start: selectionStart, end: selectionEnd}
(input)
| 6698 | * -@return {start: selectionStart, end: selectionEnd} |
| 6699 | */ |
| 6700 | function getSelection$1(input) { |
| 6701 | var selection = void 0; |
| 6702 | |
| 6703 | if ('selectionStart' in input) { |
| 6704 | // Modern browser with input or textarea. |
| 6705 | selection = { |
| 6706 | start: input.selectionStart, |
| 6707 | end: input.selectionEnd |
| 6708 | }; |
| 6709 | } else { |
| 6710 | // Content editable or old IE textarea. |
| 6711 | selection = getOffsets(input); |
| 6712 | } |
| 6713 | |
| 6714 | return selection || { start: 0, end: 0 }; |
| 6715 | } |
| 6716 | |
| 6717 | /** |
| 6718 | * @setSelection: Sets the selection bounds of a textarea or input and focuses |
no test coverage detected