Skip to content
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

DataTable: changing size of cells does not work in every situation #7229

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stephanpelikan
Copy link
Contributor

What does this PR do?

In DataTable the height is calculated in code what does not work on resizing any column's content (see #7177) if there is another plain-column. This PR is a pure CSS solution for the problem.

Where should the reviewer start?

See section "Actual Behavior" of #7177.

What testing has been done on this PR?

We manually tested both situations: On initializing the table and on changing cells content. We use this fork already in production.

How should this be manually tested?

In "Steps to reproduce" of #7177 a sandbox is provided. To test correct sizing on table initialization one can set the default-value to true at https://codesandbox.io/p/sandbox/datatable-collapse-issue-2jq6d9?file=%2Findex.js%3A255%2C1-256%2C1. Additionally, one can remove the line
https://codesandbox.io/p/sandbox/datatable-collapse-issue-2jq6d9?file=%2Findex.js%3A310%2C1-311%2C1 to also test for non-plain columns.

Do Jest tests follow these best practices?

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

Any background context you want to provide?

The author of the initial implementation didn't see that there is a pure CSS solution (see comment in https://github.com/grommet/grommet/blob/master/src/js/components/TableCell/TableCell.js#L129). Meanwhile there were changes in the same section 10c46fd which should be tested. I updated the Sandbox to Grommet's current version and the intermediate change does not effect the behavior of this PR.

What are the relevant issues?

#7177

Screenshots (if appropriate)

No

Do the grommet docs need to be updated?

No

Should this PR be mentioned in the release notes?

As you wish

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

Was backward compatible before 10c46fd. If the underlying issue of this change #6086 is still solved with the PR in place, then it is confirmed that it still is backward compatible.

@stephanpelikan stephanpelikan changed the title Feature/issue 7177 DataTable: changing size of cells does not work in every situation May 14, 2024
@jcfilben jcfilben added the PRty Biweekly PR reviews by grommet team with hoping of closing such PRs label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PRty Biweekly PR reviews by grommet team with hoping of closing such PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants