Fix Select (#3327)

This commit is contained in:
Charles Bochet 2024-01-09 14:58:14 +01:00 committed by GitHub
parent 4ebb487fa1
commit 47ac97dd25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 8 deletions

View File

@ -1,9 +1,10 @@
import { ContactLink } from "@/ui/navigation/link/components/ContactLink";
import { BrowserRouter as Router } from "react-router-dom";
import { BrowserRouter as Router } from 'react-router-dom';
import { ContactLink } from '@/ui/navigation/link/components/ContactLink';
export const MyComponent = () => {
const handleLinkClick = (event) => {
console.log("Contact link clicked!", event);
console.log('Contact link clicked!', event);
};
return (

View File

@ -26,11 +26,21 @@ export const useCommandMenu = () => {
setHotkeyScopeAndMemorizePreviousScope(AppHotkeyScope.CommandMenuOpen);
};
const closeCommandMenu = () => {
setIsCommandMenuOpened(false);
resetSelectedItem();
goBackToPreviousHotkeyScope();
};
const closeCommandMenu = useRecoilCallback(
({ snapshot }) =>
() => {
const isCommandMenuOpened = snapshot
.getLoadable(isCommandMenuOpenedState)
.getValue();
if (isCommandMenuOpened) {
setIsCommandMenuOpened(false);
resetSelectedItem();
goBackToPreviousHotkeyScope();
}
},
[goBackToPreviousHotkeyScope, resetSelectedItem, setIsCommandMenuOpened],
);
const toggleCommandMenu = useRecoilCallback(({ snapshot }) => async () => {
const isCommandMenuOpened = snapshot

View File

@ -144,6 +144,7 @@ export const SettingsObjectFieldPreview = ({
fieldName,
relationObjectMetadataNameSingular:
relationObjectMetadataItem?.nameSingular,
options: selectOptions,
},
},
hotkeyScope: 'field-preview',