When I play with slider and release the button I see the slider is still attached to mouse and moving mouse in the screen keeps moving the slider left and right. Please note this doesn’t happen always but most of the time I am able to recreate this. Any help on am I missing something ?.
Do you have a PG example? Are you using the bjs GUI? In case, do you use the slider inside a stackpanel? In case, I had something similar and would be able to help (may be)…
Ok, but this code doesn’t really tell me the story. As you say,
However, I believe I understand you must have the same case I had.
I solved it by detaching the camera when moving on the slider and reattaching it when moving out.
Try something like this (line 49 to 57 in this PG):
@mawa it didn’t help Issue is when click in progress I take it out of window and bring it back in then this issue happens… Please note from logs I see no other event is detected.
I see. Is it attached to the edge of the canvas and when you move out of the window the slider continues to be ‘grabed’ ?
Did you try to add this?
sv.isPointerBlocker = true;
or add a “window.addEventListener” for your canvas controls?
I’m pretty sure one of these should work and I’m also pretty sure there is already a thread in the forum that covers this. I will try find it for you…
@DarraghBurke when I hold click and move outside release click and come back in still its stuck, now if I take it out without holding click then it gets released.
That’s funny because it never happened to me (and I’m actually unable to reproduce).
Are any of these events/solutions we gave you appearing in the console log when you make your move?
See, my sliders mostly always have an ‘exclusion zone’ so you can never move the mouse straight from the slider area outside the canvas. Also, did you try to remove the parameters for your contextual slider? May be the bug occurs because it’s loosing context?
I sure do hope either @DarraghBurke or @sebavan will be able to further help here. I’m afraid this is slowly going beyond my expertise.
Wishing you a great WE anyway and don’t loose hope I’m sure someone in this forum will be able to finally help you out with this
What browser/device are you on? I do not repro this on Edge for Windows or MacOS. Here is the playground I am testing with, based off the one Mawa shared earlier:
Now, that’s interesting. Obviously, the iframe already acts like a ‘canvas’ (well, a frame). So this can explain why any action calling on the ‘window’ would actually not apply to the iframe.
Did you try the thing of creating a small exclusion zone around the slider, to make sure any action taken triggers (within BJS) and before you move out of (well) the iframe? As long as the action triggers inside the canvas before moving out of the window or iframe, it definetely should work and solve your issue.
@DarraghBurke Sorry for the delay was traveling. Since it was near the edge this was happening I gave a padding from the edge and now this issue is not there.