Skip to content

Commit 5d789db

Browse files
committed
Add repositionOnScroll
Signed-off-by: Lin Wang <[email protected]>
1 parent 5a894cd commit 5d789db

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

public/apps/account/account-nav-button.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function AccountNavButton(props: {
176176
const innerElement = isPlacedInLeftNav ? (
177177
<LeftBottomActionButton
178178
title={username}
179-
icon={<EuiAvatar name={username} size="s" />}
179+
icon={<EuiAvatar name={`${username}${username}`} size="s" />}
180180
isNavDrawerLocked$={props.coreStart.chrome.getIsNavDrawerLocked$()}
181181
isChromeVisible$={props.coreStart.chrome.getIsVisible$()}
182182
/>
@@ -198,8 +198,10 @@ export function AccountNavButton(props: {
198198
onClick={() => {
199199
setPopoverOpen((prevState) => !prevState);
200200
}}
201-
// Add buffer 2 to avoid popover move to top center of anchor
202-
{...(isPlacedInLeftNav ? { anchorPosition: 'rightDown', buffer: 2 } : {})}
201+
// Use buffer 0 to avoid popover move to top center of anchor
202+
{...(isPlacedInLeftNav
203+
? { anchorPosition: 'rightDown', buffer: 0, repositionOnScroll: true }
204+
: {})}
203205
>
204206
<EuiContextMenuPanel>{contextMenuPanel}</EuiContextMenuPanel>
205207
</EuiPopover>

0 commit comments

Comments
 (0)