File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { useEffect , useReducer } from "preact/hooks" ;
1+ import { useEffect , useReducer , useState } from "preact/hooks" ;
22import { DEF_PIC_URL , STUFF_STOREKEY } from "../common/constants.ts" ;
33import { _ , i18nReady } from "../common/i18n.tsx" ;
44import { Icons } from "../common/icons.tsx" ;
@@ -113,12 +113,16 @@ export default function KittyPrinter(props: KittyPrinterProps) {
113113 } ) ;
114114 } ) ;
115115 } ) ;
116+
116117 useEffect ( ( ) => {
117118 document . addEventListener ( 'paste' , ( ) => {
118- dispatch ( {
119- action : 'add' ,
120- stuff : { type : 'text' , id : 0 , triggerPaste : true }
121- } ) ;
119+ if ( document . activeElement . type !== "textarea" ) {
120+ dispatch ( {
121+ action : 'add' ,
122+ stuff : { type : 'text' , id : 0 , triggerPaste : true }
123+ } ) ;
124+ }
125+
122126 } )
123127 } , [ ] ) ;
124128 const comp = < div class = "kitty-container" >
You can’t perform that action at this time.
0 commit comments