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
Fixing activity title text truncation #10601
Conversation
@@ -27,9 +27,7 @@ export default function ListItem({ | |||
{React.isValidElement(title) ? ( | |||
title | |||
) : ( | |||
<button onClick={onClick}> |
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.
There were existing rules for list-item__title
regarding text truncation, but being the direct child of a button tag was blocking them from taking effect. This button element and associated onClick
value are actually redundant, as the list item wrapper handles the onClick
event for all of its contents:
onClick={onClick} |
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.
Huh, interesting find!
The use of button
here was important though - it allowed keyboard navigation. Though... now that I'm testing it... it seems to have made it focusable, but pressing "Enter" did nothing 😞.
Well, given that this already wasn't keyboard-friendly, this doesn't need to block here. But that's something we'll want to do. I'd suggest changing the div
with the onClick
set to a button.
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.
Builds ready [187c782]
Page Load Metrics (794 ± 170 ms)
|
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.
LGTM!
As noted in a comment, this does impact accessibility, but this list already had issues there.
Awesome work @ryanml ! |
Builds ready [a2b419e]
Page Load Metrics (621 ± 38 ms)
|
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.
LGTM!
Builds ready [73ea889]
Page Load Metrics (584 ± 27 ms)
|
Fixes #9997
Manual testing steps: