Skip to content

Commit

Permalink
Merge pull request #837 from illacloud/beta
Browse files Browse the repository at this point in the history
Merge/develop
  • Loading branch information
Wangtaofeng authored Dec 22, 2023
2 parents 642f224 + 07b58d8 commit b3de73c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/trigger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@illa-design/config-provider": "workspace:*",
"@illa-design/theme": "workspace:*",
"@illa-design/system": "workspace:*",
"@floating-ui/react": "^0.26.1",
"@floating-ui/react": "^0.26.4",
"framer-motion": "^10.16.4"
},
"peerDependencies": {
Expand Down
22 changes: 11 additions & 11 deletions packages/trigger/src/trigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const Trigger: FC<TriggerProps> = (props) => {

const closeContent = <div css={applyDefaultContentSize}>{content}</div>

const childrenRef = useRef<HTMLElement>(null)
const childrenRef = useRef<HTMLElement>((props.children as any).ref)

let centerNode: ReactElement = <></>

Expand Down Expand Up @@ -397,12 +397,12 @@ export const Trigger: FC<TriggerProps> = (props) => {
},
}),
)}
<FloatingPortal
root={_popupContainer ?? childrenRef?.current ?? document.body}
>
{!disabled && (
<AnimatePresence>
{finalVisible && (
{!disabled && (
<AnimatePresence>
{finalVisible && (
<FloatingPortal
root={_popupContainer ?? childrenRef?.current ?? document.body}
>
<div
onFocus={onFocus}
onBlur={onBlur}
Expand Down Expand Up @@ -433,10 +433,10 @@ export const Trigger: FC<TriggerProps> = (props) => {
>
{tipsNode}
</div>
)}
</AnimatePresence>
)}
</FloatingPortal>
</FloatingPortal>
)}
</AnimatePresence>
)}
</>
)
}
Expand Down
22 changes: 17 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b3de73c

Please sign in to comment.