Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Define steps for scrolling element into view #300

Closed
LJWatson opened this issue Apr 28, 2016 · 7 comments
Closed

Define steps for scrolling element into view #300

LJWatson opened this issue Apr 28, 2016 · 7 comments
Labels

Comments

@LJWatson
Copy link
Collaborator

Migrated from Bugzilla #27913.

Ping @rodneyrehm

@rodneyrehm
Copy link

This issue is discussed in whatwg/html#94 - I'm not sure who's got the lead here, WHATWG or W3C…

@travisleithead
Copy link
Member

I'm flexible. From the other issue, it looks like the scrollIntoView hook in CSSOM View has been added (w3c/csswg-drafts#81), so we just need to link into it at the appropriate place. I'd prefer a PR here, of course, but can integrate a change from WHATWG easily enough :)

@jihyerish
Copy link

jihyerish commented May 11, 2017

I noticed that scrolling triggered by focusing input elements behaves differently in browsers.

If there is a value for each input element, in Firefox(53), the scrolling stops when the value of the input element comes into view even if the input element is partially visible.
However, other browsers(Chrome, Safari, Opera) always show the focused input element entirely within the scroll view area.
See the usecase: https://jsfiddle.net/JihyeHong/7bgfvycy/

Is this just a bug of Firefox?
Or Is this usecase considered for defining steps for scrolling element into view?

I bring this up because the discussion in Bugzilla ( https://www.w3.org/Bugs/Public/show_bug.cgi?id=27913) was moved to here. : )

@chaals
Copy link
Collaborator

chaals commented May 11, 2017

@jihyerish:

If there is a value for each input element, in Firefox(53), the scrolling stops when the value of the input element comes into view even if the input element is partially visible.
However, other browsers(Chrome, Safari, Opera) always show the focused input element entirely within the scroll view area.

I think it's "sub-optimal" implementation in Firefox, which is a kind of bug.
There is a problem with the idea of "being in view" which is that you can never be entirely sure how much is viewed - as well as the browser window and zoom, you get people working with system-level magnification.

So as @rodneyrehm said elsewhere I think we should keep some leeway in where exactly scrolling puts things, which would allow current behaviours.

Finally it doesn't look like anyone has made much progress on this. @travisleithead do you think you're going to get this covered with the current milestone? Does anyone want to pick it up and deal with it?

@fenduru
Copy link

fenduru commented Nov 10, 2017

I'm working on a virtualized rendering component that manually controls the positioning of elements using translate. Rather than using typical scrolling, I set overflow: hidden. When an element gets focus, even though it is visible, the browser thinks it is in a different position and will scroll to an incorrect location. I have to manually set the scrollTop/scrollLeft back to zero after this happens, which can cause some jank.

It would be great if this was spec'd such that I could prevent this container from ever scrolling.

@chaals chaals self-assigned this Dec 4, 2017
@chaals chaals removed this from the HTML5.3 FPWD milestone Dec 4, 2017
@chaals chaals added this to the HTML5.3 WD2 milestone Feb 13, 2018
@LJWatson LJWatson modified the milestones: HTML5.3 WD2, HTML5.3 WD3 Mar 13, 2018
@chaals chaals assigned scottaohara and unassigned brucelawson and chaals Apr 17, 2018
@LJWatson LJWatson modified the milestones: HTML5.3 WD3, When it's ready Apr 24, 2018
@scottaohara
Copy link
Member

@scottaohara scottaohara removed their assignment Jul 27, 2019
@siusin
Copy link
Contributor

siusin commented Jul 29, 2019

We're closing this issue on the W3C HTML specification because the W3C and WHATWG are now working together on HTML, and all issues are being discussed on the WHATWG repository.

@siusin siusin closed this as completed Jul 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests