File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
newIDE/app/src/InstancesEditor Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,19 @@ const getImageCoordinatesFromPointerEvent = (
136136 }
137137
138138 const bounds = divContainer . getBoundingClientRect ( ) ;
139+
140+ // Ignore pointer events on the scrollbar area. getBoundingClientRect includes
141+ // scrollbars, but clientWidth/clientHeight exclude them, so any click beyond
142+ // clientWidth or clientHeight is on a scrollbar, not on the tile content.
143+ const relativeX = event . clientX - bounds . left ;
144+ const relativeY = event . clientY - bounds . top ;
145+ if (
146+ relativeX >= divContainer . clientWidth ||
147+ relativeY >= divContainer . clientHeight
148+ ) {
149+ return ;
150+ }
151+
139152 const mouseXWithoutScrollLeft = event . clientX - bounds . left + 1 ;
140153 const mouseX = mouseXWithoutScrollLeft + divContainer . scrollLeft ;
141154 const mouseY = event . clientY - bounds . top + 1 ;
You can’t perform that action at this time.
0 commit comments