Skip to content
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

Resize viewport always focuses on the same location of website #19976

Closed
byteknacker opened this issue May 27, 2016 · 5 comments
Closed

Resize viewport always focuses on the same location of website #19976

byteknacker opened this issue May 27, 2016 · 5 comments

Comments

@byteknacker
Copy link

When studying the website of Bootstrap Docs, I was resizing my browser to test the intricacies of columns and rows. However, when I did so, the page keeps jumping up and down, making it very hard for me to focus on the change that happened. I had to scroll to the correct location every time I stopped resizing the browser width.

Suggestion for a feature: to make websites built with Bootstrap always focus on the same exact location no matter what happens with resizing the browser.

This will furthermore improve user experience.

I am using:

Mac OS El Capitan 10.11.5, MacBook Pro Late 2013 Model, Chrome latest version, Bootstrap latest version.

@RyanZim
Copy link

RyanZim commented May 27, 2016

@byteknacker How would you propose to do this? I can't think of any good ways.

@rafalp
Copy link

rafalp commented May 29, 2016

Okay, so lets give this a tought...

Suggestion for a feature: to make websites built with Bootstrap always focus on the same exact location no matter what happens with resizing the browser.

This happens because way page is displayed changes due to media queries. Some elements turn from rows into lists, some images disappear, etc ect. In an nutshell, this changes page's height moving elements around.

At this point you first need to decide what constitutes the "exact location". If, say, you were 30 px scrooled into 140px tall card containing user's message, but now you have turned your device from landscape to portrait, whats the X offset to the card that's now 190px? How are you going to compute it accurately? Card's header was one-line tall (22px), but now it turned to two-line layout, making it 44px. Perhaps relation to it should be used, so we should set scrool 52px into card?

So you'll decide that checkpoint will be scroll relative to top offset of deepest element that's currently intersected by viewport's top edge. But now you need strategy for handling scenario when element itself isn't leaf node (ergo, its .container and user is scrolled right between two deeper elements). You could keep scroll at the position relative to bottom offset of last direct descendant of the intersected element.

And now you need to see how your implementation plays with scroll management in popular view libraries that are doing it as well, like React.js that also implements suffisticated scroll preservation strategies around its DOM renderer.

And then, few weeks later, while adding another preservation strategy for yet another weird edge case, you will ask yourself, if what you have fixed was really considered an issue by your users. ;)

@mdo
Copy link
Member

mdo commented May 29, 2016

Not something we plan to solve in Bootstrap, sorry.

@cvrebert
Copy link
Collaborator

cvrebert commented Jun 1, 2016

Also, browser vendors are already working on building similar native features into the browsers themselves:
WICG/interventions#2

@byteknacker
Copy link
Author

Many thanks @cvrebert I think it should be something that browser developer will take care of rather than web development frameworks. Good point @rafalp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants