1 | import isSelectable from './isSelectable';
|
2 | export default function defaultSelectHint(e, selectHint) {
|
3 | var shouldSelectHint = false;
|
4 |
|
5 | if (e.key === 'ArrowRight') {
|
6 |
|
7 |
|
8 |
|
9 | shouldSelectHint = isSelectable(e.currentTarget) ? e.currentTarget.selectionStart === e.currentTarget.value.length : true;
|
10 | }
|
11 |
|
12 | if (e.key === 'Tab') {
|
13 |
|
14 | e.preventDefault();
|
15 | shouldSelectHint = true;
|
16 | }
|
17 |
|
18 | return selectHint ? selectHint(shouldSelectHint, e) : shouldSelectHint;
|
19 | } |
\ | No newline at end of file |