Skip to content

Commit

Permalink
fix: 兼容 popup trigger 元素获取异常报错问题 (#1626)
Browse files Browse the repository at this point in the history
  • Loading branch information
honkinglin authored Oct 25, 2022
1 parent 9bf42e6 commit a099765
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/popup/hooks/useTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function useTrigger({ content, disabled, trigger, visible, onVisi
if (!shouldToggle) return;

const handleDocumentClick = (e: any) => {
if (getRefDom(triggerRef).contains(e.target) || hasPopupMouseDown.current) {
if (getRefDom(triggerRef)?.contains?.(e.target) || hasPopupMouseDown.current) {
return;
}
visible && onVisibleChange(false, { e, trigger: 'document' });
Expand Down

0 comments on commit a099765

Please sign in to comment.