-
Notifications
You must be signed in to change notification settings - Fork 87
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
Scrolling to error message #949
Conversation
This adds automatic scrolling in checkout step 3 (payment). Please comment if it is required elsewhere. |
Hi, it works very well. |
Alright, the way this current implementation works is by checking the basket error status. I will work on tying it to the inline error message in general so it can be used everywhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice solution but needs some work.
src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.html
Outdated
Show resolved
Hide resolved
src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.ts
Outdated
Show resolved
Hide resolved
src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.ts
Outdated
Show resolved
Hide resolved
Scrolling is now attached in the basket-validation-results component. It will work for all messages used there but is still not attached on messages in general. Here are some thoughts regarding general attaching to any kind of error messages:
Considering the points above I advise to simply scroll to the top when an error occurs (mentioned as alternative solution in #848). This behvior might not be archived on a message component but has to be implemented on the corresponding page. Easiest option would be to scroll automatically to the top after the checkout button gets pressed since even on success, user will land at the top for the next checkout step. Please reflect on these thoughts and decide how to proceed. |
Thank you for your feedback. I think we have a little misunderstanding: I would only add this behavior to the inline error messages - the bootstrap error alerts. Only this pattern/component:
I will check the error behavior in the whole checkout and when something is unclear or feels unnatural, I will come back to you. Is this fine for you? It seems that the demo server is not loading the pwa, yet (504 Gateway time-out). I try it later again. |
Thanks for clarifying, I guess I did in fact misunderstood your request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The auto-scrolling behavior works very well.
I noticed that some checkout messages do not scroll up automatically. Perhaps some error or info messages are not part of the basket validation result component, e.g. have no shipping address assigned or credit card is invalid.
The auto-scrolling behavior should be implemented for error-message and info-message component, if toast = false. I discussed this solution with @SGrueber.
81af6ce
to
d0ded6b
Compare
c25ffea
to
755e19e
Compare
755e19e
to
37d58b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job 👍
Co-authored-by: max.kless@googlemail.com <max.kless@googlemail.com>
PR Type
[x] Feature
What Is the Current Behavior?
On checkout error message doesn't get scrolled to
Issue Number: Closes #848
What Is the New Behavior?
When the checkout has some errors, the browser will scroll to it
Does this PR Introduce a Breaking Change?
[x] No
Other Information
Uses Scrolling Directive developed for #911
AB#71917