-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reset form-like components when the parent
<form>
resets (#2004)
* add reset button to form example * refactor React Listbox This splitsup the raw `[state, dispatch]` to separate `useActions` and `useData` hooks. This allows us to make the actions themselves simpler and include logic that doesn't really belong in the reducer itself. This also allows us to expose data via the `useData` hook that doesn't belong in the state exposed from the `useReducer` hook. E.g.: we used to store a `propsRef` from the root `Listbox`, and update the ref with the new props in a `useEffect`. Now, we will just expose that information directly via the `useData` hook. This simplifies the code, removes useEffect's and so on. * refactor Tabs, ensure function reference stays the same If the `isControlled` value changes, then the references to all the functions changed. Now they won't because of the `useEvent` hooks. * type the actions abg similar to how we type the data bag * refactor RadioGroup to use useData/useActions hooks * reset Listbox to defaultValue on form reset * reset Combobox to defaultValue on form reset * reset RadioGroup to defaultValue on form reset * reset Switch to defaultChecked on form reset * port combinations/form playground example to Vue * update changelog
- Loading branch information
1 parent
74e7b43
commit c0f0d43
Showing
21 changed files
with
1,676 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.