File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -408,21 +408,25 @@ class CodeitElement extends HTMLElement {
408408
409409 const selection = window . getSelection ( ) ;
410410 if ( ! selection . rangeCount ) return false ;
411+ selection . deleteFromDocument ( ) ;
411412
412- // if selecting codeit element itself
413+ selection . getRangeAt ( 0 ) . insertNode ( document . createTextNode ( paste ) ) ;
414+
415+ /*// if selecting codeit element itself
413416 if (selection.baseNode === cd) {
414417
415418 // insert newline
416419 cd.insert('\r');
417420
418- }
421+ }*/
419422
420- if ( hashCode ( paste ) === hashCode ( cd . textContent ) ) {
421-
422- e . preventDefault ( ) ;
423+ /* if (hashCode(paste) === hashCode(cd.textContent)) {
424+
423425 selection.getRangeAt(0).collapse();
424426
425- }
427+ }*/
428+
429+ event . preventDefault ( ) ;
426430
427431 } ) ;
428432
You can’t perform that action at this time.
0 commit comments