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

Reduce content shift on navigation #6267

Merged
merged 1 commit into from
Feb 1, 2023
Merged

Reduce content shift on navigation #6267

merged 1 commit into from
Feb 1, 2023

Conversation

fregante
Copy link
Member

Probably:

Demo

Screen.Recording.2.mov

@fregante fregante added bug ajax Temporary label to collect Ajax issues labels Jan 31, 2023
@@ -301,7 +301,7 @@ const unload = (featureUrl: string): void => {
}
};

document.addEventListener('turbo:visit', () => {
document.addEventListener('turbo:render', () => {
Copy link
Member Author

@fregante fregante Jan 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same event used to run features and it's currently attached/run before our "on load" listeners. I think this is helping avoid any flashes due to momentarily-missing classes. For example if a feature removes a class "on unload", the the "on load" listener will restore it immediately after, without a render/display of the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ajax Temporary label to collect Ajax issues bug
Development

Successfully merging this pull request may close these issues.

clean-dashboard lost after going back FOUC after Ajax navigation
1 participant