salt-ds
salt-ds copied to clipboard
ComboBox controlled causes TypeErrors with React 16
Package name(s)
Core (@salt-ds/core)
Package version(s)
1.24.0
Description
The ComboBox seems to be broken when used with React 16 (I haven't tested with React 18 as we need still to upgrade). Since we support React 16 (and need to for compatibility with UITK), this needs to be fixed.
(Note: reporting this on behalf of an internal consumer, so adding the "community" label)
Steps to reproduce
- Setup an app that uses React 16 and include some basic Controlled ComboBox code (the Custom filtering from our StoryBook. I've copied the code below for convenience)
- Type anything in the ComboBox to filter the displayed options.
The following runtime error will occur:
× TypeError Cannot read properties of null (reading 'value') at eval (https://w3k8s5.csb.app/node_modules/ salt-ds/core/dist-es/combo-box/ComboBox.js:266:24 This screen is visible only in development. It will not appear if the app crashes in production. Open your browser’s developer console to further inspect this error. This error overlay is powered by
react-error-overlayused in
create-react-app.
Error reproduced in CodeSandBox: https://codesandbox.io/p/sandbox/checkboxgroup-reproduction-forked-w3k8s5
Expected behavior
You should be able to filter the available options in the ComboBox without crashing the app
Operating system
- [ ] macOS
- [X] Windows
- [ ] Linux
- [ ] iOS
- [ ] Android
Browser
- [X] Chrome
- [ ] Safari
- [ ] Firefox
- [ ] Edge
Are you a JPMorgan Chase & Co. employee?
- [X] I am an employee of JPMorgan Chase & Co.
Happens around onChange
, likely to do with event pool.