-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Handle focus on focusable formatters #2104
Conversation
export function SelectCellFormatter({ value, tabIndex, isCellSelected, disabled, onChange }: SelectCellFormatterProps) { | ||
const inputRef = useRef<HTMLInputElement>(null); | ||
useEffect(() => { | ||
if (isCellSelected) { |
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.
User can handle focus however they like and event
can be stopped from propagating for complex components.
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, just needs a changelog.
return ( | ||
<> | ||
<div className="rdg-child-row-action-cross" /> | ||
{isDeleteSubRowEnabled && ( | ||
<div className="rdg-child-row-btn" onClick={onDeleteSubRow}> | ||
❌ | ||
<span |
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.
Why add another element?
Also I think if you just set onClick={onDeleteSubRow}
instead of handling onKeyDown
manually it might work just as well.
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.
https://www.w3.org/TR/wai-aria-practices/#gridNav_focus
https://www.loom.com/share/3a0e559f0ea04db98226c3169dffad04