Skip to content

Commit cb5af8a

Browse files
author
chenyueban
committed
feat(Tooltip): Tooltip does not render by default
1 parent 171c96b commit cb5af8a

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

packages/fluent-ui-hooks/src/usePopper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface usePropperOptions extends PopperJS.PopperOptions {}
66

77
export function usePopper({
88
placement = 'bottom',
9-
positionFixed = false,
9+
positionFixed = true,
1010
eventsEnabled = true,
1111
...otherOptions
1212
}: usePropperOptions): [React.MutableRefObject<null>, React.MutableRefObject<null>] {

packages/fluent-ui/src/Command/Command.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ const Command = React.forwardRef<HTMLDivElement, CommandProps>(
5858
}
5959
)
6060

61+
// Secondary Popup related
6162
const {
62-
visible: secondaryVisible,
63+
// visible: secondaryVisible,
6364
setVisible: setSecondaryVisible,
6465
Portal: SecondaryPortal
6566
} = usePortal()
@@ -113,13 +114,12 @@ const Command = React.forwardRef<HTMLDivElement, CommandProps>(
113114
<MoreIcon />
114115
</CommandButton>
115116
))}
116-
{secondaryVisible && (
117-
<SecondaryPortal style={portalStyle}>
118-
<StyledSecondaryContainer ref={secondaryRef} acrylic={acrylic}>
119-
{container.secondary}
120-
</StyledSecondaryContainer>
121-
</SecondaryPortal>
122-
)}
117+
118+
<SecondaryPortal style={portalStyle}>
119+
<StyledSecondaryContainer ref={secondaryRef} acrylic={acrylic}>
120+
{container.secondary}
121+
</StyledSecondaryContainer>
122+
</SecondaryPortal>
123123
</CommandContext.Provider>
124124
</StyledContainer>
125125
)

packages/fluent-ui/src/Tooltip/Tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const Tooltip = ({
5959
return (
6060
<>
6161
{React.cloneElement(children, { ref: referenceRef, ...bind })}
62-
<Transition visible={isVisible} wrapper={false}>
62+
<Transition visible={isVisible} wrapper={false} mountOnEnter unmountOnExit>
6363
{content}
6464
</Transition>
6565
</>

0 commit comments

Comments
 (0)