File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
www/packages/docs-ui/src/providers/AiAssistant Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import React, {
1313import type { Source } from "@kapaai/react-sdk"
1414import useResizeObserver from "@react-hook/resize-observer"
1515import { AiAssistantSearchWindow } from "../../components"
16+ import { useIsBrowser } from "../BrowserProvider"
1617
1718export type AiAssistantChatType = "default" | "popover"
1819
@@ -66,6 +67,7 @@ const AiAssistantInnerProvider = ({
6667 ( ) => isGeneratingAnswer || isPreparingAnswer ,
6768 [ isGeneratingAnswer , isPreparingAnswer ]
6869 )
70+ const { isBrowser } = useIsBrowser ( )
6971
7072 const scrollToBottom = ( ) => {
7173 if ( preventAutoScroll ) {
@@ -133,6 +135,19 @@ const AiAssistantInnerProvider = ({
133135 } )
134136 } , [ scrollToBottom ] )
135137
138+ /**
139+ * This effect is required to avoid recaptcha messing up
140+ * the page layout.
141+ */
142+ useEffect ( ( ) => {
143+ if ( ! isBrowser ) {
144+ return
145+ }
146+
147+ const recaptchaElm = document . querySelector ( ".grecaptcha-badge" )
148+ recaptchaElm ?. parentElement ?. classList . add ( "absolute" )
149+ } , [ isBrowser ] )
150+
136151 return (
137152 < AiAssistantContext . Provider
138153 value = { {
You can’t perform that action at this time.
0 commit comments