[Dashboards] Auto focus effect on standalone widget (#17623)
closes https://discord.com/channels/1130383047699738754/1467809255771078719 before - https://github.com/user-attachments/assets/3af6dbfd-358c-44fd-9419-338791fd5cfc after - https://github.com/user-attachments/assets/2e8f89f8-5989-4e62-9bc0-6ddd47c0d421
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
|
||||
import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';
|
||||
import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';
|
||||
import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
|
||||
import { useSetRecoilComponentState } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentState';
|
||||
|
||||
@@ -24,6 +26,7 @@ export const useEditPageLayoutWidget = (pageLayoutIdFromProps?: string) => {
|
||||
|
||||
const { navigatePageLayoutCommandMenu } = useNavigatePageLayoutCommandMenu();
|
||||
const { closeCommandMenu } = useCommandMenu();
|
||||
const setCommandMenuPage = useSetRecoilState(commandMenuPageState);
|
||||
|
||||
const handleEditWidget = useCallback(
|
||||
({
|
||||
@@ -53,12 +56,14 @@ export const useEditPageLayoutWidget = (pageLayoutIdFromProps?: string) => {
|
||||
return;
|
||||
}
|
||||
|
||||
setCommandMenuPage(CommandMenuPages.Root);
|
||||
closeCommandMenu();
|
||||
},
|
||||
[
|
||||
setPageLayoutEditingWidgetId,
|
||||
navigatePageLayoutCommandMenu,
|
||||
closeCommandMenu,
|
||||
setCommandMenuPage,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user