File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
userscripts/natasquare/helper Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -786,7 +786,15 @@ function initRecipeLookup({ v_container, v_sidebar }) {
786786
787787 let hidden = false ;
788788 modal . addEventListener ( "mousedown" , function ( e ) {
789- if ( e . target === e . currentTarget ) return closeRecipeModal ( ) ;
789+ if ( e . target === e . currentTarget ) {
790+ // apparently this is also true when clicking on the scrollbar
791+ // so a bound check is ineviatable
792+ const rect = modal . getBoundingClientRect ( ) ;
793+ if ( e . clientX < rect . left ||
794+ e . clientX > rect . right ||
795+ e . clientY < rect . top ||
796+ e . clientY > rect . bottom ) closeRecipeModal ( )
797+ }
790798 if ( e . button === 2 ) return ;
791799 const item = traverseUntil ( e . target , ".item" ) ;
792800 if ( ! item ) return ;
You can’t perform that action at this time.
0 commit comments