-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Embeddables Rebuild] [Controls] Fix data control editor type selector (
#187390) Closes #187382 ## Summary This PR separates out the previously memoized `CompatibleControlTypesComponent` into a separate component that accepts **props** for the fields that it is dependant on rather than relying on the dependencies to the `useMemo` function. This is because, previously, we had an extra dependency in the dependency array (`controlType`) that was causing the memoized component to render too many times and it was causing a weird bug where the old "disabled" menu item wasn't getting unmounted properly. | Before | After | |--------|--------| | ![Jul-02-2024 13-21-44](https://github.com/elastic/kibana/assets/8698078/240b561e-f3b7-4519-bfe1-caf550927310) | ![Jul-02-2024 13-12-29](https://github.com/elastic/kibana/assets/8698078/4f9b4eb6-2ce3-471e-a5b8-4b92179c48bc) | By switching to a component with explicit props, unnecessary dependencies should hopefully be avoided in the future. ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- Loading branch information
Showing
1 changed file
with
77 additions
and
59 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