fix: clamp notification dropdown to viewport, bump ui to 0.2.15

Apply viewport clamping to NotificationCenter dropdown positioning
and bump @ciphera-net/ui to 0.2.15 which clamps AppLauncher and
UserMenu dropdowns the same way.
This commit is contained in:
Usman Baig
2026-03-19 00:43:58 +01:00
parent 1755dcb9dc
commit 89343caf65
3 changed files with 12 additions and 6 deletions

View File

@@ -61,7 +61,12 @@ export default function NotificationCenter({ anchor = 'bottom', variant = 'defau
const updatePosition = useCallback(() => {
if (anchor === 'right' && buttonRef.current) {
const rect = buttonRef.current.getBoundingClientRect()
setFixedPos({ left: rect.right + 8, top: rect.top })
let top = rect.top
if (panelRef.current) {
const maxTop = window.innerHeight - panelRef.current.offsetHeight - 8
top = Math.min(top, Math.max(8, maxTop))
}
setFixedPos({ left: rect.right + 8, top })
}
}, [anchor])
@@ -95,6 +100,7 @@ export default function NotificationCenter({ anchor = 'bottom', variant = 'defau
if (open) {
fetchNotifications()
updatePosition()
requestAnimationFrame(() => updatePosition())
}
}, [open, updatePosition])