Skip to content

Fix DataTable flex and pagination issue #6501

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

Merged
merged 5 commits into from
Nov 21, 2022

Conversation

jcfilben
Copy link
Collaborator

@jcfilben jcfilben commented Nov 16, 2022

What does this PR do?

Fixed an issue introduced in #6439 that caused cells to stretch (see screenshots). This PR reverts the change from #6439 but still fixes the original issue #6333.

Cells are stretching:
Screen Shot 2022-11-16 at 12 20 47 PM

Fixed:
Screen Shot 2022-11-16 at 12 20 23 PM

Where should the reviewer start?

What testing has been done on this PR?

Tested with the code from #6333 and tested with the MultiplePins story by adding step={3} and paginate.

How should this be manually tested?

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?

#6333
grommet/hpe-design-system#2949

Screenshots (if appropriate)

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?

Backwards compatible

@jcfilben jcfilben requested a review from taysea November 16, 2022 21:01
alignSelf="end"
// flex none needed for Pagination controls to stay in correct
// location and prevent overflow outside container
style={{ flex: 'none' }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any way this can be handled in paginationProps or something other than style?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good comment, I changed this to be flex={false} to avoid using the style prop.

alignSelf="end"
// flex false is needed for Pagination controls to stay in
// correct location and prevent overflow outside container
flex={false}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should Pagination set this itself internally? When would we ever want Pagination to flex?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question. I couldn't think of a case where we want Pagination to flex. I went back and added flex={false} to Pagination

<Pagination alignSelf="end" {...paginationProps} />
<Pagination
alignSelf="end"
// flex false is needed for Pagination controls to stay in
Copy link
Contributor

Choose a reason for hiding this comment

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

Can probably remove this comment now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops yes forgot to remove that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@ericsoderberghp ericsoderberghp merged commit cd42dec into grommet:master Nov 21, 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.

4 participants