Skip to content

Commit

Permalink
Rewrite <FormTokenField> to functional component and Typescript. (#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>

* 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 <[email protected]>

* Update packages/components/src/form-token-field/types.ts

Co-authored-by: Lena Morita <[email protected]>

* Update packages/components/src/form-token-field/index.tsx

Co-authored-by: Lena Morita <[email protected]>

* Update packages/components/src/form-token-field/index.tsx

Co-authored-by: Lena Morita <[email protected]>

* Update packages/components/src/form-token-field/index.tsx

Co-authored-by: Lena Morita <[email protected]>

* 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 <[email protected]>

Co-authored-by: Lena Morita <[email protected]>
  • Loading branch information
torounit and mirka authored Jun 2, 2022
1 parent 97fc302 commit ef6c5e9
Show file tree
Hide file tree
Showing 14 changed files with 1,228 additions and 978 deletions.
8 changes: 8 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unreleased

### Bug Fix

- `FormTokenField`: Do not suggest the selected one even if `{ value: string }` is passed ([#41216](https://github.com/WordPress/gutenberg/pull/41216)).

### Internal

- `FormTokenField`: Convert to TypeScirpt and refactor to functional component ([#41216](https://github.com/WordPress/gutenberg/pull/41216)).

## 19.12.0 (2022-06-01)

### Bug Fix
Expand Down
Loading

0 comments on commit ef6c5e9

Please sign in to comment.