Fixes on side panel closing and table rows and board cards activation (#12609)
Fixes https://github.com/twentyhq/core-team-issues/issues/1096 This PR: - Prevents interaction with elements inside the index page when the side panel is opened, except for switching between records - Prevents stacking multiple records in the side panel navigation stack when navigating from the index - Adds activation and unfocus logic for board cards when clicked - Fixes table row activation after clicking on a record chip Before: https://github.com/user-attachments/assets/dcfec9fb-392b-4760-9b11-b0f077087b82 After: https://github.com/user-attachments/assets/93e0dc6a-c693-4484-b23e-f5ae291eb472
This commit is contained in:
@ -51,12 +51,14 @@ export const CommandMenuOpenContainer = ({
|
||||
|
||||
const handleClickOutside = useRecoilCallback(
|
||||
({ snapshot }) =>
|
||||
() => {
|
||||
(event: MouseEvent | TouchEvent) => {
|
||||
const hotkeyScope = snapshot
|
||||
.getLoadable(currentHotkeyScopeState)
|
||||
.getValue();
|
||||
|
||||
if (hotkeyScope?.scope === CommandMenuHotkeyScope.CommandMenuFocused) {
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
closeCommandMenu();
|
||||
}
|
||||
},
|
||||
|
||||
@ -38,10 +38,12 @@ export const useOpenRecordInCommandMenu = () => {
|
||||
recordId,
|
||||
objectNameSingular,
|
||||
isNewRecord = false,
|
||||
resetNavigationStack = false,
|
||||
}: {
|
||||
recordId: string;
|
||||
objectNameSingular: string;
|
||||
isNewRecord?: boolean;
|
||||
resetNavigationStack?: boolean;
|
||||
}) => {
|
||||
const navigationStack = getSnapshotValue(
|
||||
snapshot,
|
||||
@ -171,7 +173,7 @@ export const useOpenRecordInCommandMenu = () => {
|
||||
pageIcon: Icon,
|
||||
pageIconColor: IconColor,
|
||||
pageId: pageComponentInstanceId,
|
||||
resetNavigationStack: false,
|
||||
resetNavigationStack,
|
||||
});
|
||||
|
||||
if (objectNameSingular === CoreObjectNameSingular.WorkflowRun) {
|
||||
|
||||
Reference in New Issue
Block a user