react-magma
react-magma copied to clipboard
Dropdown open/closed status cannot persist between renders
Describe the bug Re-renders of a Dropdown instance render with the Dropdown in a "closed" state. Current functionality does not provide for persistence of the Dropdown's open/closed status between render cycles.
Additional context
- The desired behavior is that the parent component is given a means to control the Dropdowns open/closed status.
- The following is an example where this behavior is not accessible:
- Dropdown content consists of a form element.
- Form element contains Checkbox elements, acting as toggleable filters.
- Checkbox values are defined pre-render. Therefore, Checkbox values are kept in parent component state.
- Checkbox onChange functions manipulate parent component state, which causes the Dropdown to re-render in a closed state.
- Drawer/Modal are examples of components which take an
isOpenprop, whcih would provide the desired functionality.
Note: only fix in v3. Release before December 2022
Not reproducible. This is addressed by using Dropdown form.