acl-services / paprika

🌶 A robust + accessible UI component library for React applications by Galvanize.
MIT License
54 stars 9 forks source link

Uxd 1984 Data Table updates on data change #1233

Closed tristanjasper closed 2 years ago

tristanjasper commented 2 years ago

Purpose 🚀

Currently when the source data prop of a table changes: a) A dataTable without the Infinite loader sub component will not show a vertical scrollbar b) A dataTable with the Infinite loader will not evaluate the correct row heights, making long text strings get cut off.

This pr is a proposal to have the dataTable update when data changes and

  1. Re-evaluate the row heights based on row data changes, leading to long strings being cut off.
  2. Resize the outer container div meaning additional rows will not be hidden

This pr ensures that DataTable resizes and re-renders correctly when the source data is changed.

Note Additionally discovered a bug which i'll create an issue for- On the Data change story Click "Add Item" button three times Then click "Save" The DataTable with InfiniteLoader renders with a vertical scrollbar even though it is below the maxHeight value.

Notes ✏️

details of code change / secondary purposes of this PR

Updates 📦

If you have changed a component's source code (not stories, specs, or docs), before merging your branch run yarn changeset. This will prompt you to:

Storybook 📕

http://storybooks.highbond-s3.com/paprika/your-branch-name

Screenshots 📸

optional but highly recommended

References 🔗

relevant Jira ticket / GitHub issues

changeset-bot[bot] commented 2 years ago

🦋 Changeset detected

Latest commit: 875d3589aa5cf644ea9afa45b96ef9a6101edf22

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------- | ----- | | @paprika/data-table | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

tristanjasper commented 2 years ago

Added an issue for the height bug as mentioned in the description here