Skip to content

Form now scrolls up if warning is shown#699

Merged
imobachgs merged 3 commits intoagama-project:masterfrom
balsa-asanovic:improve-form-errors
Aug 12, 2023
Merged

Form now scrolls up if warning is shown#699
imobachgs merged 3 commits intoagama-project:masterfrom
balsa-asanovic:improve-form-errors

Conversation

@balsa-asanovic
Copy link
Copy Markdown
Contributor

Problem

Forms generally show errors on top, so when the submit is clicked again if the error is shown again, it seems as if nothing happens.

fixes #468

Solution

I've attached a useRef hook to the alert and whenever the component is rendered with the error it will scroll up to it.

Testing

No unit test for this component.
Tested manually.

Screenshots

image
image

Copy link
Copy Markdown
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

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

Thanks @balsa-asanovic! The change looks good. Please, add an entry to the changes file that includes a reference to the bug (gh##468).

@balsa-asanovic
Copy link
Copy Markdown
Contributor Author

@imobachgs added entry to the changes file.

Copy link
Copy Markdown
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM. I will merge as soon as the tests run.

@imobachgs imobachgs merged commit ff4b61c into agama-project:master Aug 12, 2023
@balsa-asanovic balsa-asanovic deleted the improve-form-errors branch September 18, 2023 19:44
@imobachgs imobachgs mentioned this pull request Sep 26, 2023
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

Successfully merging this pull request may close these issues.

Improve form errors

2 participants