4

Please check this CodePen. The problem is described there. There is also a demo. I've tested it on Mac and Windows.

There is the same behavior in Chrome (on Mac and Windows).

Meanwhile, other browsers (even Safari and Opera which are on WebKit too) do not jump to the nearest snap point instantly.

It is a bug?

If so, what is the correct place where I can report it? Or what is the correct place (WebKit related) where I can ask about it?


// Snippet of code required by Stack Overflow to post a question
slider.addEventListener("scroll", _.debounce((e) => {
    const currentHeight = parseFloat(e.target.style["height"]);
    e.target.style["height"] = currentHeight + (flag ? 5 : -5) + "px";
    flag = !flag;
}, 50));
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Denis
  • 2,429
  • 5
  • 33
  • 61
  • Confirmed it's happening, however I find most of these weird issues have a logical explanation and are not actually bugs. Nevertheless I'll look around. I've had something similar, but not exactly this. – Clayton Engle Sep 03 '21 at 13:03
  • FYI Chromium derived browsers (incl. Opera) use [Blink](https://en.wikipedia.org/wiki/Blink_(browser_engine)) which is a fork of WebKit but definitely not the same. – phuzi Sep 03 '21 at 13:18
  • @Denis Sorry, I did not understand your exact question? When I leave mouse click the box was moving to left or right automatically to align the box with container. Is that the problem or something else? – Abhilash Augustine Sep 03 '21 at 14:13
  • https://bugs.chromium.org/p/chromium/issues/detail?id=1181843 – Denis Sep 03 '21 at 15:10
  • @AbhilashAugustine, if you open inspector, turn on responsive mode, and drag the slider slowly, you will see it bounce back to start over and over. – Clayton Engle Sep 03 '21 at 18:45
  • The error message is ***"Links to codepen.io must be accompanied by code."***. – Peter Mortensen May 10 '22 at 19:27
  • *"The problem is described there"*: But the problem should be described ***here***. Both the question and answers are essentially link-only posts. – Peter Mortensen May 10 '22 at 19:31

1 Answers1

0

"Chrome introduced auto-snap after layout changes in M81." (from Scroll snapping after layout changes)

Issue 1181843: Scroll-snap jumps to the nearest snap position on repaint in Chrome

This behavior is intentional in Chrome, unfortunately.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Denis
  • 2,429
  • 5
  • 33
  • 61