Skip to content

Commit ef6c5e9

Browse files
torounitmirka
andauthored
Rewrite <FormTokenField> to functional component and Typescript. (#41216)
* refactor `<TokenInput>` to functional component and Typescript. * Remove findRenderedComponentWithType as it does not work with functional components. * use findRenderedDOMComponentWithTag instead of findRenderedComponentWithType * convert `<Token>` to TypeScript * type only import * convert SuggestionsList to TypeScript * Change to not use withSafeTimeout. ref: #19109 * Remove comment because tabIndex is not specified. * add type for dom-scroll-into-view * add form-token-field dir to include in tsconfig.json * refactoring types. * fix type. * refactor FormTokenField to TypeScript and Functional Component * refactor story * allow set suggestions in stories. * Use act where useEffect is relevant. * separate state * revert ts-nocheck * remove onChange prop form storybook * Update packages/components/src/form-token-field/token-input.tsx Co-authored-by: Lena Morita <lena@jaguchi.com> * use ComponentProps * add type docs * replace token-field-wrapper to tsx * add doc comment for FormTokenField * fix type docs * Update packages/components/src/form-token-field/types.ts Co-authored-by: Lena Morita <lena@jaguchi.com> * Update packages/components/src/form-token-field/types.ts Co-authored-by: Lena Morita <lena@jaguchi.com> * Update packages/components/src/form-token-field/index.tsx Co-authored-by: Lena Morita <lena@jaguchi.com> * Update packages/components/src/form-token-field/index.tsx Co-authored-by: Lena Morita <lena@jaguchi.com> * Update packages/components/src/form-token-field/index.tsx Co-authored-by: Lena Morita <lena@jaguchi.com> * change variable and function name * Fix useEffect to updateSuggestions(). * Disabled control for __experimentalValidateInput. Update type document. * add changelog * Update packages/components/src/form-token-field/index.tsx Co-authored-by: Lena Morita <lena@jaguchi.com> Co-authored-by: Lena Morita <lena@jaguchi.com>
1 parent 97fc302 commit ef6c5e9

File tree

14 files changed

+1228
-978
lines changed

14 files changed

+1228
-978
lines changed

packages/components/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## Unreleased
44

5+
### Bug Fix
6+
7+
- `FormTokenField`: Do not suggest the selected one even if `{ value: string }` is passed ([#41216](https://github.com/WordPress/gutenberg/pull/41216)).
8+
9+
### Internal
10+
11+
- `FormTokenField`: Convert to TypeScirpt and refactor to functional component ([#41216](https://github.com/WordPress/gutenberg/pull/41216)).
12+
513
## 19.12.0 (2022-06-01)
614

715
### Bug Fix

0 commit comments

Comments
 (0)