asscroll icon indicating copy to clipboard operation
asscroll copied to clipboard

Horizontal Scroll Demo

Open ashthornton opened this issue 3 years ago • 8 comments

ashthornton avatar May 04 '21 07:05 ashthornton

Hey Ash, if you could point us in the right direction regarding horizontal scrolling that would be awesome! I've been tinkering with it but it looks like it's currently unfinished? If I set the <main asscroll-container> width manually it works, but there's no calculation happening as of yet, right?

S-n-d avatar May 13 '21 14:05 S-n-d

Hey @S-n-d, it is functional, you just need the right set up. Usually this can be done with flex and setting the elements to not grow or shrink so they render at their natural width, which would cause a horizontal overflow of the ASScroll container element. I will see if I can put together a quick demo over the next day or two.

ashthornton avatar May 15 '21 11:05 ashthornton

@ashthornton thanks for giving a nudge in the right direction. Looking forward to the demo!

S-n-d avatar May 17 '21 11:05 S-n-d

It’s only possible to activate horizontalScroll within asscroll.enable, right? Is the horizontal scroll only possible with vertical input (touchpad) and with a vertical scrollbar, or am I doing something wrong? Would be nice if we could define the orientation directly when defining the new ASScroll instance or if we could at least change the input and scrollbar direction inside asscroll.enable. I think it’s not intuitive to mix up the directions, even though I would like to let the site be scrolled with vertical as well as horizontal input.

grommas avatar Jun 24 '21 13:06 grommas

Hi @grommas, are you asking if it would be possible to scroll with a horizontal mouse wheel? Or if you could just change the scrollbar location to the bottom and the orientation to horizontal, when in horizontal mode?

ashthornton avatar Jul 03 '21 10:07 ashthornton

Hi @ashthornton, thanks for your reply. Both!

grommas avatar Jul 03 '21 11:07 grommas

@grommas so the current horizontal scroll functionality is designed to work the way it does now - moving the page horizontally based on vertical scroll position. It's a design decision based on the fact that it is uncommon to have a horizontal scroll wheel on a mouse but I also wanted to allow horizontal page movement.

I think it could be nice if ASScroll detects whether the page has X or Y overflow and adjusts the scrollbar orientation and scroll behaviour accordingly. But this would also need to be interchangeable with allowing horizontal scroll to be controlled with a vertical mouse wheel when required.

It's definitely something I will consider adding in the future, but isn't a priority right now.

ashthornton avatar Jul 03 '21 12:07 ashthornton

Thanks for your answer! I think for trackpad users it’s logical to scroll the x-axis with horizontal swipes. I totally understand, that vertical scroll inputs make sense for some design decisions, but for others it may break with the intention of native horizontal scroll elements.

grommas avatar Jul 27 '21 11:07 grommas