Skip to content

Conversation

amandadupell
Copy link
Contributor

What does this PR do?

Fixes incorrect highlighting of the first row in a table after selecting another item, clicking outside of the table, and trying to select a disabled row. Looked into the "pinnable" highlight behavior noted in the issue but could be a separate issue (not sure of the expected behavior vs. actual behavior).

Where should the reviewer start?

Body.js

What testing has been done on this PR?

Manual testing

How should this be manually tested?

Use the onSelect story in Storybook

Do Jest tests follow these best practices?

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • userEvent is used in place of fireEvent.
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

What are the relevant issues?

#6165

Screenshots (if appropriate)

Video Showing Issue

Screen.Recording.2022-06-16.at.12.44.55.PM.mov

Video Showing Fix

Screen.Recording.2022-06-16.at.12.33.45.PM.mov

Do the grommet docs need to be updated?

No

Should this PR be mentioned in the release notes?

Yes

Is this change backwards compatible or is it a breaking change?

Compatible

Copy link
Collaborator

@britt6612 britt6612 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me wondering why it was set too 0

Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the DataTable/Clickable story if I only use the keyboard to navigate I can't get to any of the options (open the story, press tab to get focus on the DataTable, and then try to navigate through options with the up and down arrows). Only after clicking an option am I able to use the keyboard to navigate to other options.

@britt6612
Copy link
Collaborator

britt6612 commented Jun 16, 2022

In the DataTable/Clickable story if I only use the keyboard to navigate I can't get to any of the options (open the story, press tab to get focus on the DataTable, and then try to navigate through options with the up and down arrows). Only after clicking an option am I able to use the keyboard to navigate to other options.

good catch thinking that was the reasoning behind the 0

@amandadupell amandadupell requested a review from jcfilben June 16, 2022 21:10
Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jcfilben jcfilben requested a review from ericsoderberghp June 16, 2022 23:01
@ericsoderberghp ericsoderberghp linked an issue Jun 17, 2022 that may be closed by this pull request
@ericsoderberghp ericsoderberghp merged commit 2067f53 into grommet:master Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect row highlight behavior in DataTable
5 participants