jpmorganchase / salt-ds

React UI components built with a focus on accessibility, customisation and ease-of-use
https://www.saltdesignsystem.com
Apache License 2.0
109 stars 78 forks source link

Combo Box defaultValue is not used #3579

Closed origami-z closed 1 week ago

origami-z commented 2 weeks ago

Package name(s)

Core (@salt-ds/core)

Package version(s)

No response

Description

https://github.com/jpmorganchase/salt-ds/blob/40e9372ffce47f3e83c87bb7eccc9a6cb1cc0f3d/packages/core/src/combo-box/useComboBox.tsx#L44-L52

Probably missing brackets

    default:
      defaultValue ?? ((selectedState.length === 1 && !multiselect)
        ? listControl.valueToString(selectedState[0])
        : defaultValue),

Steps to reproduce

No response

Expected behavior

No response

Operating system

Browser

Are you a JPMorgan Chase & Co. employee?

origami-z commented 1 week ago

Fixed in @salt-ds/core@1.30.0