# ScrollBar and PointerBlocker

**URL:** <https://forum.babylonjs.com/t/scrollbar-and-pointerblocker/28732>\
**Category:** Bugs\
**Created:** [March 24, 2022, 4:07pm UTC](https://forum.babylonjs.com/t/scrollbar-and-pointerblocker/28732 "2022-03-24T16:07:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [March 24, 2022, 4:07pm UTC](https://forum.babylonjs.com/t/scrollbar-and-pointerblocker/28732/1 "2022-03-24T16:07:24Z")

</div>

Hi there,  
in my application i’ve a GUI with a grid inside a ScrollViewer that can overlap some meshes.  
These meshes are pickable and can react to mouse move events. When i show the GUI i don’t want that the user could interact with meshes, so i set `isPointerBlocker = true` on all the GUI elements, and generally it works…till now 🙂 I found that if the user moves the scroll bar the `PointerOver` event is triggered anyway by the mesh. Is it a bug or am i forgetting something?  
This is a PG to repro the issue: [https://playground.babylonjs.com/#XNY77K#3](https://playground.babylonjs.com/#XNY77K#3)  
The sphere changes the colour when mouse is over, and with no GUI that overlaps. But if you move the sliding bar, the `PointerOver` event is not blocked.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [March 24, 2022, 11:40pm UTC](https://forum.babylonjs.com/t/scrollbar-and-pointerblocker/28732/2 "2022-03-24T23:40:39Z")

</div>

Maybe @DarraghBurke can help?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 14, 2022, 12:33pm UTC](https://forum.babylonjs.com/t/scrollbar-and-pointerblocker/28732/3 "2022-04-14T12:33:25Z")

</div>

Hello! Apologies for this not having been answered, sometimes things slip by us 🙁 I’m not sure about the pointerBlocker behavior (@DarraghBurke will be more qualified to know if this is expected or not), but I thought about an alternative solution without it, you could set the mesh isPickable property as false when the pointer enters a control, and to true when the pointer leaves: [Test scrollbar and pointerblock | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#XNY77K#5)

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 14, 2022, 12:33pm UTC](https://forum.babylonjs.com/t/scrollbar-and-pointerblocker/28732/4 "2022-04-14T12:33:30Z")

</div>

Assigned @DarraghBurke on April 14, 2022, 12:33pm UTC



---

<div class="post-metadata">

**Author:** ![DarraghBurke](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/darraghburke/32/10621_2.png) [@DarraghBurke](https://forum.babylonjs.com/u/DarraghBurke)\
**Post date:** [April 14, 2022, 6:27pm UTC](https://forum.babylonjs.com/t/scrollbar-and-pointerblocker/28732/5 "2022-04-14T18:27:37Z")

</div>

Hey, so sorry about the delay in getting back to you! I missed the original ping on the forum.

Here is a PR to resolve this issue: [[GUI] Block pointer events to scene when pointer is captured by darraghjburke · Pull Request #12400 · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/pull/12400)

What it will do is block pointer events from being passed to the scene when the pointer is captured (for example, if you’re dragging on a scrollviewer or slider).

---

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [April 15, 2022, 7:02am UTC](https://forum.babylonjs.com/t/scrollbar-and-pointerblocker/28732/6 "2022-04-15T07:02:57Z")

</div>

Thank you, don’t worry for the delay it’s not a problem. I needed only confirmation that was a bug 😉

---

<div class="post-metadata">

**Author:** ![DarraghBurke](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/darraghburke/32/10621_2.png) [@DarraghBurke](https://forum.babylonjs.com/u/DarraghBurke)\
**Post date:** [April 15, 2022, 4:46pm UTC](https://forum.babylonjs.com/t/scrollbar-and-pointerblocker/28732/7 "2022-04-15T16:46:08Z")

</div>

Unassigned @DarraghBurke on April 15, 2022, 4:46pm UTC


