question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Save space for error messages in order to avoid page jumps on validation

See original GitHub issue

Which package is this issue related to?

ffe-form

Describe your issue (screenshots welcome!)

In some instances the page layout may jump when validation error messages are inserted, because an extra line of content is injected into the page flow.

Without error message:

image

With error message:

image

This can be avoided by saving the space needed for an error message by default (padding, height, etc), then positioning the error message absolute or in other ways style it so that it does not affect the height of its containing block.

What is the expected behavior?

The page flow should not change on validation.

What is the actual behavior?

The page jumps.

Steps to reproduce

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
ivarnicommented, May 10, 2019

I’ll try that later, and if not I can swap the error element to a p.

:first-of-type did work, so I could do

.ffe-radio-block {
    margin-top: -10px;
    margin-bottom: 30px;

   &:first-of-type {
       margin-top: 20px;
   }
}

But I kinda threw up in my mouth a little so unless your trick works I’ll go with a p.

1reaction
ivarnicommented, May 10, 2019

30lwj1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Designing Better Error Messages UX - Smashing Magazine
Let's explore when error messages should live above input fields and ... If the page is fully refreshed upon validation, the error summary ......
Read more >
Form validation best practices. A case study of how to get it right
Instead, focus on concise, directional, friendly copy for you error messages. Avoid long list summaries of errors at the top of your page, ......
Read more >
Should I make space for error messages in forms?
I think you're ignoring the use of immediate validation. Yes, it would push the rest of the form down, but the user hasn't...
Read more >
Best Practices for Hints and Validation in Web Forms - WebFX
Any error message should communicate the following as best it can: List all errors: To make sure a user gets the form on...
Read more >
How to Report Errors in Forms: 10 Design Guidelines
1. Aim for Inline Validation Whenever Possible · 2. Indicate Successful Entry for Complex Fields · 3. Keep Error Messages Next to Fields...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found