diff --git a/client/src/components/embedding/index.tsx b/client/src/components/embedding/index.tsx index ca17f22d6..1e922688a 100644 --- a/client/src/components/embedding/index.tsx +++ b/client/src/components/embedding/index.tsx @@ -65,6 +65,10 @@ const Embedding = (props: Props) => { const isSpatial = getFeatureFlag(FEATURES.SPATIAL); + /** + * (thuang): Attach to `onOpening` event to only track the event when the user + * clicks on the dropdown to open the popover, not when the popover is closed. + */ const handleLayoutChoiceClick = (): void => { track( isSidePanel @@ -115,6 +119,7 @@ const Embedding = (props: Props) => { { }} icon={IconNames.GRAPH} rightIcon={IconNames.CARET_DOWN} - onClick={handleLayoutChoiceClick} > {layoutChoice?.current}