dxc-technology / halstack-react

Library of components for building SPAs with React and Halstack Design System
https://developer.dxc.com/halstack/
Apache License 2.0
15 stars 14 forks source link

DxcSelect crashes application with searchable, multiple and empty array #1786

Closed djdannycastillo closed 8 months ago

djdannycastillo commented 8 months ago

Describe the bug DxcSelect crashes application when setting select with searchable, multiple and receives an empty array.

To Reproduce Try below component

<DxcSelect label="Select your coworkers" placeholder="Choose a colleague" options={[]} searchable multiple />

Example:

  1. Try adding the DxcSelect with searchable and multiple option
  2. Pass an empty array and you should see app crash

Expected behaviour Avoid app crash when the component receives an empty array

Screenshots Screenshot 2024-01-29 at 19 18 38

Add labels Bug

GomezIvann commented 8 months ago

Hello @djdannycastillo!

You are correct, the DxcSelect seems to be crushing when the flag searchable is true and the list of options is empty. We are going to review this with high priority.

Thanks for the feedback!