New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting the primary scrolling direction for a scroll container #10060
Comments
Just as a personal opinion: I personally prefer the concept of overflow, instead of scroll for CSS, for example, I would prefer a property named
Because overflow is a more "style-oriented" name, although I started the topic using the concept of scroll, for the purpose of intuitively describing the issue. A primary overflow direction is only suggestive information, it only tells an UA which direction is expected to be scrolled only by the user (or at least to be scrolled far more frequently than the other direction). The UA then takes advantage of the knowledge, and improves UX as far as possible, for example, by "converting" the default actions of wheel events for a mouse with one single directional wheel. |
Further argument: Why is this feature necessary for CSS? What's the problem if a JavaScript developer programmatically implements such a feature?
|
I think UAs should be doing this automatically, based on the principal writing mode. So I guess there's a few questions:
|
It's absolutely reasonable to do this automatically based on the principal writing mode. However, as an alternate solution, I would also like to further introduce just my two cents on adding a new property: While what this issue mainly aims to handle is about vertical writing mode, there might also be cases where it's desirable for pages even when it's principal writing mode is horizontal. For example, a
Yes, there're at least bugs filed for this kind of issues, as far as I know, on bugzilla.mozilla.org: Years ago, the issue was mentioned by David Baron, and then I implemented later on, the Firefox Desktop team also utilises the Unfortunately, the big disadvantage of Things are much better if we solve this issue with CSS: the issue that |
That seems... expected?
Can you explain why? |
Not necessarily. Imagine an article with a horizontal image gallery. If the reader is only interested in the article text, it would be surprising/annoying for them if while scrolling down the scroll direction suddenly changed within the image gallery. Sebastian |
@SebastianZ gave a good example why On the contrary, with CSS, we can selectively affect pages or elements where the developer is pretty sure the user will be eager to scroll horizontally(e.g. a page with vertical principal writing mode, or a bunch of extremely wide cityscape pictures on a city fan website the user will definitely be interested in). This is where a CSS solution will go beyond |
I don't understand. Wasn't the behavior taking into consideration both
Suppose the gallery is vertical instead of horizontal. Why should that be different? Either the user wants to scroll through the image gallery or they don't. Laying out the gallery horizontally vs vertically shouldn't make a difference to whether scroll events are sent to the gallery or the main page. |
Sorry for being unclear. When I said "CSS unaware", I meant we hadn't introduced any CSS private property to do
It does matter based on whether
If If |
Let me summarize my personal key solution for this topic in possibly a shortest sentence: All we need is selectiveness. Example 1:
Example 2:
Example 3:
|
BTW, just one more thing: A name just came to my mind: But |
Currently, almost all UAs assume the vertical direction is the first-class scrolling direction, so that UAs set the default action of a pure wheel event to scrolling the content vertically, while setting the default action of a wheel event with an additional key(typically Shift Key) to scrolling the content horizontally.
That's a reasonable assumption for a page in horizontal writing mode. A page in vertical writing mode, however, is another story, which is much more likely to overflow horizontally.
If we can set an element's primary scrolling direction, then an UA knows that it can set the default action of the pure wheel event to scrolling the content horizontally, while setting the default action of a wheel event with an additional key to scrolling the content vertically.
Also, there are two vertical writing modes:
vertical-rl
andvertical-lr
. It is worth suggesting UAs to logically "convert" scrolling direction.The text was updated successfully, but these errors were encountered: