File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -391,7 +391,7 @@ class CodeitElement extends HTMLElement {
391391
392392 cd . on ( 'paste cut' , ( ) => { cd . dispatchEvent ( typeEvent ) } ) ;
393393
394- cd . on ( 'type mousedown mouseup touchstart touchend focus blur' ,
394+ cd . on ( 'keydown mousedown mouseup touchstart touchend focus blur' ,
395395 ( ) => { onNextFrame ( checkCaretPosEvent ) } , false ) ;
396396
397397
@@ -1284,13 +1284,13 @@ class CodeitElement extends HTMLElement {
12841284
12851285 // if start pos is bigger than codeit length,
12861286 // set start pos to codeit length
1287- if ( startPos > cd . textContent . length ) startPos = cd . textContent . length - 1 ;
1287+ if ( startPos > cd . textContent . length ) startPos = cd . textContent . length ;
12881288
12891289 if ( endPos ) {
12901290
12911291 // if end pos is bigger than codeit length,
12921292 // set end pos to codeit length
1293- if ( endPos > cd . textContent . length ) endPos = cd . textContent . length - 1 ;
1293+ if ( endPos > cd . textContent . length ) endPos = cd . textContent . length ;
12941294
12951295 // get caret node and offset
12961296 c = getCaretNode ( startPos , endPos ) ;
You can’t perform that action at this time.
0 commit comments