diff --git a/packages/ui/src/components/chat/ChatInput.tsx b/packages/ui/src/components/chat/ChatInput.tsx index 849046fb..c936c54f 100644 --- a/packages/ui/src/components/chat/ChatInput.tsx +++ b/packages/ui/src/components/chat/ChatInput.tsx @@ -1350,7 +1350,10 @@ export const ChatInput: React.FC = ({ onOpenSettings, scrollToBo
0 && !isKeyboardOpen ? { marginBottom: `${inputBarOffset}px` } : undefined} > diff --git a/packages/ui/src/components/layout/MainLayout.tsx b/packages/ui/src/components/layout/MainLayout.tsx index f4c6f6be..daa28eb3 100644 --- a/packages/ui/src/components/layout/MainLayout.tsx +++ b/packages/ui/src/components/layout/MainLayout.tsx @@ -201,6 +201,10 @@ export const MainLayout: React.FC = () => { root.style.setProperty('--oc-keyboard-inset', `${stickyKeyboardInset}px`); previousHeight = height; + const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent); + const keyboardHomeIndicator = isIOS && stickyKeyboardInset > 0 ? 34 : 0; + root.style.setProperty('--oc-keyboard-home-indicator', `${keyboardHomeIndicator}px`); + const avoidTarget = isTextTarget ? resolveKeyboardAvoidTarget(active) : null; if (!isMobile || !avoidTarget || !active) { diff --git a/packages/ui/src/index.css b/packages/ui/src/index.css index fc8d6f69..ac6db64f 100644 --- a/packages/ui/src/index.css +++ b/packages/ui/src/index.css @@ -13,6 +13,7 @@ --oc-visual-viewport-offset-top: 0px; --oc-keyboard-inset: 0px; --oc-keyboard-avoid-offset: 0px; + --oc-keyboard-home-indicator: 0px; --ui-regular-font-weight: 400; --oc-scrollbar-thumb: oklch(0.32 0.03 50 / 0.4); --oc-scrollbar-thumb-hover: oklch(0.32 0.03 50 / 0.6); @@ -1173,6 +1174,11 @@ html:not(.dark) .chat-scroll { padding-bottom: var(--oc-safe-area-bottom-visual) !important; } + /* iOS keyboard home indicator safe area - used when keyboard is open */ + .ios-keyboard-safe-area { + padding-bottom: calc(var(--oc-keyboard-home-indicator, 34px) + var(--oc-safe-area-bottom-visual, 0px)) !important; + } + /* Prevent keyboard-induced page scroll on iOS PWA */ body { min-height: 100vh;