File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
- import { refKey } from "./utils" ;
1
+ import { min , refKey } from "./utils" ;
2
2
3
3
/**
4
4
* @internal
@@ -41,15 +41,15 @@ export const initSelectionStore = (
41
41
const pos = el . selectionStart ! ;
42
42
if ( ! compositionEvent ) return pos ;
43
43
// compensate selection range during compositioning
44
- return Math . min ( pos , el . selectionEnd ! - compositionEvent . data . length ) ;
44
+ return min ( pos , el . selectionEnd ! - compositionEvent . data . length ) ;
45
45
} ,
46
46
_getSelectionEnd ( ) : number {
47
47
const el = ref [ refKey ] ;
48
48
if ( ! el ) return 0 ;
49
49
const pos = el . selectionEnd ! ;
50
50
// compensate selection range during compositioning
51
51
if ( ! compositionEvent ) return pos ;
52
- return Math . min ( pos , el . selectionStart ! + compositionEvent . data . length ) ;
52
+ return min ( pos , el . selectionStart ! + compositionEvent . data . length ) ;
53
53
} ,
54
54
} ;
55
55
return handle ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @internal
3
+ */
4
+ export const { min } = Math ;
5
+
1
6
/**
2
7
* @internal
3
8
*/
You can’t perform that action at this time.
0 commit comments