vue-slider-component icon indicating copy to clipboard operation
vue-slider-component copied to clipboard

[vue3.x] Weried behavior of Dot

Open markegor opened this issue 2 years ago • 4 comments

Found weried behavior: when i am setting up "dotSize" larger than mouse cursor size, grabing it not at the center, and start moving mouse, then dot's center sharply "jumps" under the mouse cursor.

Detailed explanation with an example:

  • I have a horizontal (vertical has the same bug) slider. Its width is 1000px.
  • And I have 100px width (or height - for vertical slider) dot. Its x-position is 0px (it means that its left border has -50px x-pos).
  • When i am only grabbing the dot (without moving a mouse) at the 75px of 100px (by x-direction) - nothing happens.
  • But after starting moving a mouse, for example, for 5px (by x-direction) to the right, then the dot's center "jumps" under my mouse and i am already getting passed 30px instead of 5px.

Expected behavior: after grabbing slider's dot at any X (for horizontal) or Y (for vertical) position and moving it, dot passed the same distance as mouse cursor.

Component Version - v4.1.0-beta.2

markegor avatar Nov 30 '22 22:11 markegor

Can you provide an online example

NightCatSama avatar Dec 07 '22 03:12 NightCatSama

Can you provide an online example

https://codesandbox.io/s/exciting-taussig-4hjwx0

Try grabbing and moving the dot by the green line (when the dot is on the left side of the slider) and the blue line (when the dot is on the right side of the slider). You will see that the first movements of the dot is a bit abrupt and strange.

markegor avatar Dec 07 '22 07:12 markegor

@NightCatSama , any updates about this bug?

markegor avatar Dec 28 '22 20:12 markegor

It looks like the spacing between the left and right sides is not excluded if the container is set equal to true.

Under normal circumstances, the pointer is always at the center of the slider.

There is no time to fix this issue, you can use style to achieve the left and right spacing.

NightCatSama avatar Jan 10 '23 03:01 NightCatSama