File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2254,8 +2254,17 @@ <h3>設定</h3>
2254
2254
//console.log(document.getElementById("cursor").children[1].selectionStart, document.getElementById("cursor").children[1].selectionEnd);
2255
2255
if ( e . data == null || e . data == undefined ) {
2256
2256
if ( e . inputType == "deleteContentBackward" ) {
2257
+ let i = 0 ;
2258
+ let count = ( ( range ) => range . endOffset - range . startOffset ) ( e . getTargetRanges ( ) [ 0 ] ) ;
2259
+ while ( count > 0 ) {
2260
+ count -= texts [ cursor_pos [ 0 ] ] [ cursor_pos [ 1 ] - i ] . length ;
2261
+ i ++ ;
2262
+ }
2257
2263
let ev = new KeyboardEvent ( "keydown" , { key : "Backspace" , isComposing : false } ) ;
2258
- e . target . dispatchEvent ( ev ) ;
2264
+ while ( i > 0 ) {
2265
+ e . target . dispatchEvent ( ev ) ;
2266
+ i -- ;
2267
+ }
2259
2268
}
2260
2269
return ;
2261
2270
}
You can’t perform that action at this time.
0 commit comments