Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Dec 19, 2023
1 parent 82a7b69 commit d33d7f0
Showing 1 changed file with 40 additions and 42 deletions.
82 changes: 40 additions & 42 deletions frontend/src/lib/components/TaxonomicPopover/TaxonomicPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,47 +75,45 @@ export function TaxonomicPopover<ValueType extends TaxonomicFilterValue = Taxono
}, [value])

return (
<div className="LemonButtonWithSideAction">
<LemonDropdown
overlay={
<TaxonomicFilter
groupType={groupType}
value={value}
onChange={({ type }, payload, item) => {
onChange?.(payload as ValueType, type, item)
setVisible(false)
}}
taxonomicGroupTypes={groupTypes ?? [groupType]}
eventNames={eventNames}
hogQLTable={hogQLTable}
excludedProperties={excludedProperties}
/>
}
sameWidth={false}
actionable
visible={visible}
onClickOutside={() => {
setVisible(false)
}}
>
{isClearButtonShown ? (
<LemonButton
sideAction={{
icon: <IconClose />,
tooltip: 'Clear selection',
onClick: (e) => {
e.stopPropagation()
onChange?.('' as ValueType, groupType, null)
setLocalValue('' as ValueType)
},
divider: false,
}}
{...buttonPropsFinal}
/>
) : (
<LemonButton {...buttonPropsFinal} />
)}
</LemonDropdown>
</div>
<LemonDropdown
overlay={
<TaxonomicFilter
groupType={groupType}
value={value}
onChange={({ type }, payload, item) => {
onChange?.(payload as ValueType, type, item)
setVisible(false)
}}
taxonomicGroupTypes={groupTypes ?? [groupType]}
eventNames={eventNames}
hogQLTable={hogQLTable}
excludedProperties={excludedProperties}
/>
}
sameWidth={false}
actionable
visible={visible}
onClickOutside={() => {
setVisible(false)
}}
>
{isClearButtonShown ? (
<LemonButton
sideAction={{
icon: <IconClose />,
tooltip: 'Clear selection',
onClick: (e) => {
e.stopPropagation()
onChange?.('' as ValueType, groupType, null)
setLocalValue('' as ValueType)
},
divider: false,
}}
{...buttonPropsFinal}
/>
) : (
<LemonButton {...buttonPropsFinal} />
)}
</LemonDropdown>
)
}

0 comments on commit d33d7f0

Please sign in to comment.