File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2106,6 +2106,7 @@ <h3>設定</h3>
2106
2106
}
2107
2107
} else if ( ( e . code == "Backspace" || e . key == "Backspace" ) && ! e . isComposing ) {
2108
2108
if ( mode == EDITOR_MODES . MODERN ) {
2109
+ e . preventDefault ( ) ;
2109
2110
if ( selecting ) {
2110
2111
deleteSelected ( ) ;
2111
2112
draw ( ) ;
@@ -2242,6 +2243,10 @@ <h3>設定</h3>
2242
2243
console . log ( e . type , e ) ;
2243
2244
//console.log(document.getElementById("cursor").children[1].selectionStart, document.getElementById("cursor").children[1].selectionEnd);
2244
2245
if ( e . data == null || e . data == undefined ) {
2246
+ if ( e . inputType == "deleteContentBackward" ) {
2247
+ let ev = new KeyboardEvent ( "keydown" , { key : "Backspace" , isComposing : false } ) ;
2248
+ e . target . dispatchEvent ( ev ) ;
2249
+ }
2245
2250
return ;
2246
2251
}
2247
2252
if ( composing ) {
@@ -2252,7 +2257,6 @@ <h3>設定</h3>
2252
2257
texts [ cursor_pos [ 0 ] ] = UTF8String . fromString (
2253
2258
texts [ cursor_pos [ 0 ] ] . slice ( 0 , cursor_pos [ 1 ] ) + e . data + texts [ cursor_pos [ 0 ] ] . slice ( cursor_pos [ 1 ] )
2254
2259
) ;
2255
- let word ;
2256
2260
let wordStart , wordCursor , wordEnd ;
2257
2261
wordStart = wordCursor = wordEnd = cursor_pos [ 1 ] + UTF8String . fromString ( e . data ) . length ;
2258
2262
while ( wordStart > 0 ) {
You can’t perform that action at this time.
0 commit comments