Fix bugs tied to jotai migration (#18227)
Fixing a few bugs: - CommandMenu not reactive - Filtering on index view infinite loop
This commit is contained in:
+4
-2
@@ -1,3 +1,5 @@
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { ScrollWrapperComponentInstanceContext } from '@/ui/utilities/scroll/states/contexts/ScrollWrapperComponentInstanceContext';
|
||||
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
|
||||
import { useHTMLElementByIdWhenAvailable } from '~/hooks/useHTMLElementByIdWhenAvailable';
|
||||
@@ -15,13 +17,13 @@ export const useScrollWrapperHTMLElement = (
|
||||
const { element: scrollWrapperHTMLElement } =
|
||||
useHTMLElementByIdWhenAvailable(scrollWrapperId);
|
||||
|
||||
const getScrollWrapperElement = () => {
|
||||
const getScrollWrapperElement = useCallback(() => {
|
||||
const scrollWrapperElement = document.getElementById(scrollWrapperId);
|
||||
|
||||
return {
|
||||
scrollWrapperElement,
|
||||
};
|
||||
};
|
||||
}, [scrollWrapperId]);
|
||||
|
||||
return {
|
||||
scrollWrapperHTMLElement,
|
||||
|
||||
Reference in New Issue
Block a user