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

Prevent flash of multi-level fields when form editor loads #1969

Closed
kevinwhoffman opened this issue Aug 8, 2017 · 0 comments
Closed

Prevent flash of multi-level fields when form editor loads #1969

kevinwhoffman opened this issue Aug 8, 2017 · 0 comments
Assignees
Milestone

Comments

@kevinwhoffman
Copy link
Contributor

Issue Overview

Every time the form editor loads, the multi-level fields appear on screen for a half second before they are hidden by JS.

Expected Behavior

The page should load with only default fields visible.

image

Current Behavior

The page loads with all fields visible before JS hides some of them. Any field that is visible here but not in the screenshot above should be hidden by default.

image

Possible Solution

WordPress includes a js body class on admin pages when JavaScript is enabled. We can use that selector to hide fields by default via CSS rather than waiting until JS processes the DOM and then hides them. This means the page loads with the correct styles by default without having to wait for JS to parse the DOM. For example:

.js _give_display_style_field { display: none; }

Steps to Reproduce (for bugs)

Load the form editor screen and watch as the multi-level fields appear briefly before being hidden.

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

No branches or pull requests

2 participants