scania-digital-design-system / tegel

Tegel Design System
https://tegel.scania.com
MIT License
17 stars 13 forks source link

fix(dropdown): async data source handling #707

Closed theJohnnyMe closed 2 months ago

theJohnnyMe commented 2 months ago

Describe pull-request

If the dropdown does not have children, but the default option is set, it would throw a lot of errors in the console. Some users have an async way of adding data later to the component so they end up in errors even if their state is "normal". Now we stop processing in the early stage. Also lopping over dropdown items is improved.

Issue Linking:

How to test

  1. Open the preview link
  2. Check if adding a default value works as expected in the component
  3. Try to add more items to the dropdown during the lifetime (fun times in the console ahead :D )

Checklist before submission

Additional context

I might try to set up an example on one of the demo pages if needed.

github-actions[bot] commented 2 months ago

Playwright test results

passed  361 passed

Details

stats  361 tests across 111 suites
duration  47.1 seconds
commit  a29948c

aws-amplify-eu-north-1[bot] commented 2 months ago

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-707.d3fazya28914g3.amplifyapp.com

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud