fix: Company picker opening when it shouldn't (#7023)

### The Company Picker opens when it shouldn't.

Fixes #6989 

### Video


https://github.com/user-attachments/assets/a1e56418-8409-46e8-879a-d8335593ea28
This commit is contained in:
Divyesh Patel 2024-09-16 18:55:59 +05:30 committed by GitHub
parent 03fa5913d8
commit 3d9620a98c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ import { getLinkToShowPage } from '@/object-metadata/utils/getLinkToShowPage';
import { useRecordChipData } from '@/object-record/hooks/useRecordChipData'; import { useRecordChipData } from '@/object-record/hooks/useRecordChipData';
import { ObjectRecord } from '@/object-record/types/ObjectRecord'; import { ObjectRecord } from '@/object-record/types/ObjectRecord';
import { UndecoratedLink } from '@/ui/navigation/link/components/UndecoratedLink'; import { UndecoratedLink } from '@/ui/navigation/link/components/UndecoratedLink';
import { MouseEvent } from 'react';
export type RecordChipProps = { export type RecordChipProps = {
objectNameSingular: string; objectNameSingular: string;
@ -23,8 +24,15 @@ export const RecordChip = ({
record, record,
}); });
const handleClick = (e: MouseEvent<HTMLAnchorElement>) => {
e.stopPropagation();
};
return ( return (
<UndecoratedLink to={getLinkToShowPage(objectNameSingular, record)}> <UndecoratedLink
onClick={handleClick}
to={getLinkToShowPage(objectNameSingular, record)}
>
<AvatarChip <AvatarChip
placeholderColorSeed={record.id} placeholderColorSeed={record.id}
name={recordChipData.name} name={recordChipData.name}