diff --git a/packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/demos/Chatbot.tsx b/packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/demos/Chatbot.tsx index d790e540..0d5c2ca3 100644 --- a/packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/demos/Chatbot.tsx +++ b/packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/demos/Chatbot.tsx @@ -286,9 +286,12 @@ export const ChatbotDemo: React.FunctionComponent = () => { const handleSkipToContent = (e) => { e.preventDefault(); if (displayMode === ChatbotDisplayMode.default) { - if (toggleRef.current) { + if (!chatbotVisible && toggleRef.current) { toggleRef.current.focus(); } + if (chatbotVisible && chatbotRef.current) { + chatbotRef.current.focus(); + } } else { if (chatbotRef.current) { chatbotRef.current.focus(); diff --git a/packages/module/src/Chatbot/Chatbot.tsx b/packages/module/src/Chatbot/Chatbot.tsx index 8dee3ffd..8c94509c 100644 --- a/packages/module/src/Chatbot/Chatbot.tsx +++ b/packages/module/src/Chatbot/Chatbot.tsx @@ -58,15 +58,14 @@ const ChatbotBase: React.FunctionComponent = ({ {/* Ref is intended for use with skip to chatbot links, etc. */} {/* Motion.div does not accept refs */} {isVisible ? ( -
{children} -
+ ) : undefined} );