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
Accessibility: Improve keyboard accessibility in Collapse
#59022
Conversation
@@ -145,10 +145,10 @@ export const Collapse = ({ | |||
|
|||
return ( | |||
<div className={panelClass}> | |||
<div className={headerClass} onClick={onClickToggle}> | |||
<button type="button" className={cx(buttonStyles, headerClass)} onClick={onClickToggle}> |
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.
Seems like a similar button is used more than once, should we have a separate component for it? Maybe a modified version of IconButton
?
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.
@Clarity-89 don't quite understand - do you mean creating a component for <button type="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.
Basically, but also with the clear button styles.
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.
ah got it. yeah that could have value... 🤔 lemme have a think about implementation
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.
gonna merge for now whilst we think about an implementation for exposing an unstyled button.
debating between just exposing a new Button
variant (unstyled
), or a whole new component UnstyledButton
. neither of which feel super nice tbh. wondering whether we shouldn't expose this as although it's being used quite a bit internally, i don't think we'd want to expose it externally as part of @grafana/ui
? idk, any thoughts? 🤔
…rafana#59097) Accessibility: Improve keyboard accessibility in `Collapse` (grafana#59022) fix keyboard accessibility in Collapse (cherry picked from commit 19e97a1) Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
What is this feature?
<button>
) for the collapse headerWhy do we need this feature?
Who is this feature for?
Which issue(s) does this PR fix?:
Fixes #59021
Special notes for your reviewer: