Skip to content

Commit

Permalink
chore: rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Apr 10, 2024
1 parent bb27516 commit fbb88f0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/SelectTrigger.tsx
@@ -1,5 +1,4 @@
import Trigger from '@rc-component/trigger';
import type { TriggerRef } from '@rc-component/trigger';
import type { AlignType, BuildInPlacements } from '@rc-component/trigger/lib/interface';
import classNames from 'classnames';
import * as React from 'react';
Expand Down Expand Up @@ -144,10 +143,10 @@ const SelectTrigger: React.ForwardRefRenderFunction<RefTriggerProps, SelectTrigg
}

// ======================= Ref =======================
const triggerRef = React.useRef<TriggerRef>(null);
const popupRef = React.useRef<HTMLDivElement>(null);

React.useImperativeHandle(ref, () => ({
getPopupElement: () => triggerRef.current?.popupElement,
getPopupElement: () => popupRef.current,
}));

return (
Expand All @@ -159,7 +158,11 @@ const SelectTrigger: React.ForwardRefRenderFunction<RefTriggerProps, SelectTrigg
builtinPlacements={mergedBuiltinPlacements}
prefixCls={dropdownPrefixCls}
popupTransitionName={mergedTransitionName}
popup={<div onMouseEnter={onPopupMouseEnter}>{popupNode}</div>}
popup={
<div ref={popupRef} onMouseEnter={onPopupMouseEnter}>
{popupNode}
</div>
}
stretch={stretch}
popupAlign={dropdownAlign}
popupVisible={visible}
Expand Down

0 comments on commit fbb88f0

Please sign in to comment.