File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
apps/webapp/app/components/code Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -228,10 +228,12 @@ export const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(
228228 document . documentElement . style . userSelect = "" ;
229229 el . style . userSelect = "" ;
230230 document . removeEventListener ( "mouseup" , restore ) ;
231+ window . removeEventListener ( "blur" , restore ) ;
231232 restoreRef . current = null ;
232233 } ;
233234 restoreRef . current = restore ;
234- document . addEventListener ( "mouseup" , restore ) ;
235+ document . addEventListener ( "mouseup" , restore , { once : true } ) ;
236+ window . addEventListener ( "blur" , restore , { once : true } ) ;
235237 } , [ ] ) ;
236238
237239 useEffect ( ( ) => {
@@ -413,7 +415,7 @@ export const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(
413415 </ Button >
414416 </ DialogHeader >
415417
416- < div onMouseDown = { handleCodeMouseDown } >
418+ < div onMouseDown = { handleCodeMouseDown } className = "overflow-auto px-3 py-3 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600" >
417419 { shouldHighlight ? (
418420 < HighlightCode
419421 theme = { theme }
You can’t perform that action at this time.
0 commit comments