Skip to content

Commit e0c8f5c

Browse files
fix: preserve popup typography inside page containers
1 parent d5eef8f commit e0c8f5c

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/components/ContentWithPopup/ContentWithPopup.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const ContentWithPopup = ({
1919
pinOnClick,
2020
hasArrow = true,
2121
placement = ['top', 'bottom'],
22+
floatingStyles,
2223
...props
2324
}: ContentWithPopupProps) => {
2425
const [isPopupVisible, setIsPopupVisible] = React.useState(false);
@@ -46,6 +47,7 @@ export const ContentWithPopup = ({
4647
<React.Fragment>
4748
<Popup
4849
container={container}
50+
floatingStyles={{fontFamily: 'var(--g-text-body-font-family)', ...floatingStyles}}
4951
anchorElement={anchor.current}
5052
open={isPinned || isPopupVisible}
5153
placement={placement}

‎src/components/HoverPopup/HoverPopup.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ export const HoverPopup = ({
160160
{anchorElement ? (
161161
<Popup
162162
container={container}
163+
// Keep portal typography when the page uses a different font.
164+
floatingStyles={{fontFamily: 'var(--g-text-body-font-family)'}}
163165
anchorElement={anchorElement}
164166
onOpenChange={(_open, _event, reason) => {
165167
if (reason === 'escape-key') {

0 commit comments

Comments
 (0)