diff --git a/packages/gitbook/src/components/AIChat/AIChatInput.tsx b/packages/gitbook/src/components/AIChat/AIChatInput.tsx index ee9ca5aca2..074ec60d6c 100644 --- a/packages/gitbook/src/components/AIChat/AIChatInput.tsx +++ b/packages/gitbook/src/components/AIChat/AIChatInput.tsx @@ -34,7 +34,13 @@ export function AIChatInput(props: { useEffect(() => { if (!disabled && !loading) { - inputRef.current?.focus(); + // Add a small delay to ensure the input is rendered before focusing + // This fixes inconsistent focus behaviour across browsers + const timeout = setTimeout(() => { + inputRef.current?.focus(); + }, 50); + + return () => clearTimeout(timeout); } }, [disabled, loading]); @@ -120,8 +126,8 @@ export function AIChatInput(props: { arrow >
- - AI + + {t(language, 'ai_chat_context_badge')} {' '} {t(language, 'ai_chat_context_title')}
diff --git a/packages/gitbook/src/components/primitives/Button.tsx b/packages/gitbook/src/components/primitives/Button.tsx index d2cd4fcff2..70834518cd 100644 --- a/packages/gitbook/src/components/primitives/Button.tsx +++ b/packages/gitbook/src/components/primitives/Button.tsx @@ -36,7 +36,7 @@ export const variantClasses = { 'bg-transparent', 'text-tint', 'border-0', - 'shadow-none', + '!shadow-none', 'hover:bg-primary-hover', 'hover:text-primary-strong', 'hover:scale-1',