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

Flickering of initially hidden fields #93

Open
kitzberger opened this issue Jul 9, 2024 · 5 comments
Open

Flickering of initially hidden fields #93

kitzberger opened this issue Jul 9, 2024 · 5 comments

Comments

@kitzberger
Copy link

Hi,

we've noticed that fields that are initially hidden (by a hide condition) are being displayed for a short time when loading a form in the frontend and are only hidden after the 3132 request has been made and its content processed. This is confusing/irritading to some of our users.

How could this flickering of fields be reduced and the UX be improved?

It should be relatively easy to render the information gathered by ConditionController->buildConditionAction() to the fieldsets/fields markup directly so the initial loading of 3132 could even be skipped and only be performed after the first user input?

I'd like to know whether or not this sounds like a solid approach to you, before digging further into this and start working on a PR.

@Patta
Copy link
Contributor

Patta commented Jul 9, 2024

@kitzberger i can confirm this issue. we hide the initial hidden fields with css to avoid this "glitch".

You could insert the css directly into the form with a form field of type html

<style>
.powermail_fieldwrap_initialhiddenfieldmarker,
.powermail_fieldwrap_initialhiddenfield2marker
{
display: none;
}
</style>

@kitzberger
Copy link
Author

Yup, something like that, but auto-generated. So our editors wouldn't have to think about that. Maybe a simple viewhelper that outputs that CSS?

@Patta
Copy link
Contributor

Patta commented Jul 10, 2024

that would be great indeed! (UX)

@kitzberger
Copy link
Author

kitzberger commented Jul 10, 2024

And additionally to the display:none we'd have to handle the required attribute of those fields as well... maybe more?

Since there's so much going on in PowermailConditions.js it'll be probably best to not try to re-build its logic serverside.

What about this approach:

That way we don't need to wait for the AJAX-calls response 🤔 (but still have less flickering)

@einpraegsam?

@kitzberger
Copy link
Author

@Patta, I've created a PR for the 10.1.x branch of this extension. I appreciate any feedback :-)

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