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

Release-4.0.0: (HDS-2069) New Select part 3 (rebased) #1358

Merged
merged 8 commits into from
Sep 23, 2024

Conversation

NikoHelle
Copy link
Contributor

@NikoHelle NikoHelle commented Sep 10, 2024

New rebased version of older PR

Description

Note: Target branch is the feature branch of the select

Third part of the new Select.

Added:

  • multiselect
  • tags
  • virtualization of long lists

Related Issue

Closes HDS-2069

How Has This Been Tested?

Added unit tests

Demos:

Links to demos are in the comments

Screenshots (if appropriate):

Add to changelog

Added in last PR

Renamed util functions to be clearer.
Sometimes text interpolation needs option.label, so it should be passable.
List components are created according to what (accessibility) attributes and props the components require.

Single selects and multi selects without groups have same kind of props for the list components

Single selects with group have own props and then there is still multi select with groups.

Currently the list elements are missing some aria-attributes, so axe tests are failing, but rules are loosened.
Only 2 rows of selected tags should be shown, so this is needed there.
Dropped old virtualization system for accessibility reasons. Option components are memoized so re-rendering even large lists after a multiselect group click is fast.

The bottleneck is (was) the first render when menu is clicked. With long lists, the initial opening can be so slow, the user clicks again. And closes the menu.

Solution is to render options in chunks. The useRenderChildrenInChunks hook, renders list items tick by tick, so initial render is fast and user sees no difference.
Copy link

Test Results

1 files  4 suites   1m 12s ⏱️
4 tests 4 ✅ 0 💤 0 ❌
8 runs  8 ✅ 0 💤 0 ❌

Results for commit 7320c5b.

Copy link

Preview found from hds-demo docs/preview_1358

Demos

Docs
Core Storybook
React Storybook

Copy link
Contributor

@mrTuomoK mrTuomoK left a comment

Choose a reason for hiding this comment

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

Super work altogether 🔥 . Didn't find anything wrong.

Copy link
Contributor

@laurakarhu laurakarhu 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 to me, some minor questions but nothing blocking from my side.

@NikoHelle NikoHelle merged commit 83a79c1 into feature/hds-2069-select-v4 Sep 23, 2024
8 checks passed
@NikoHelle NikoHelle deleted the hds-2069-select-part-3-rebase branch September 23, 2024 06:30
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.

3 participants