File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -402,9 +402,11 @@ class CodeitElement extends HTMLElement {
402402 const text = window . getSelection ( ) . toString ( ) ;
403403 e . clipboardData . setData ( 'text/plain' , text ) ;
404404
405+ recordHistory ( ) ;
406+
405407 cd . deleteCurrentSelection ( ) ;
406408
407- cd . dispatchEvent ( typeEvent ) ;
409+ recordHistory ( ) ;
408410
409411 e . preventDefault ( ) ;
410412
@@ -425,14 +427,16 @@ class CodeitElement extends HTMLElement {
425427 const selection = window . getSelection ( ) ;
426428 if ( ! selection . rangeCount ) return false ;
427429
430+ recordHistory ( ) ;
431+
428432 // if selection isn't collapsed, delete it
429433 if ( ! selection . getRangeAt ( 0 ) . collapsed ) {
430434 cd . deleteCurrentSelection ( ) ;
431435 }
432436
433437 cd . insert ( paste ) ;
434438
435- cd . dispatchEvent ( typeEvent ) ;
439+ recordHistory ( ) ;
436440
437441 e . preventDefault ( ) ;
438442
You can’t perform that action at this time.
0 commit comments