-
Notifications
You must be signed in to change notification settings - Fork 8
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
Error text overflow #2432
base: main
Are you sure you want to change the base?
Error text overflow #2432
Conversation
@m-akinc, will you buddy this PR for me? |
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.
Could/should we replace the ErrorPattern
interface with a mixin? Would be nice to remove all the declarations of those three properties and automatically enforce the @attr
and @observable
expectations.
<div | ||
class="error-text" | ||
${overflow('errorHasOverflow')} | ||
title="${x => (x.errorHasOverflow && x.errorText ? x.errorText : null)}" |
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.
Probably worthwhile to write unit tests for this behavior against one (not all) of the components that use this pattern. I'm pretty sure we have some existing title overflow behavior tests for labels, etc.
Pull Request
π€¨ Rationale
Fixes #2431
π©βπ» Implementation
The shared error pattern has been updated to use the
overflow
directive to track when the error text has overflow and to only show thetitle
when overflow is present. As part of this, each component that implementsErrorPattern
was updated to include anobservable
property namederrorHasOverflow
to correctly implement theErrorPattern
interface.π§ͺ Testing
Manually tested in storybook that all updated components:
title
on the error text when the error text is shorttitle
on the error text when the error text overflowsβ Checklist