@@ -19,6 +19,7 @@ import {
1919} from 'react' ;
2020import JumpButton from './JumpButton' ;
2121import { ButtonProps , getResizeObserver , TooltipProps } from '@patternfly/react-core' ;
22+ import { css } from '@patternfly/react-styles' ;
2223
2324export interface MessageBoxProps extends HTMLProps < HTMLDivElement > {
2425 /** Content that can be announced, such as a new message, for screen readers */
@@ -47,6 +48,8 @@ export interface MessageBoxProps extends HTMLProps<HTMLDivElement> {
4748 jumpButtonTopTooltipProps ?: TooltipProps ;
4849 /** Props passed to top jump button tooltip */
4950 jumpButtonBottomTooltipProps ?: TooltipProps ;
51+ /** Whether scrollbar is on the page or message box in embedded mode */
52+ hasOuterScrollbar ?: boolean ;
5053}
5154
5255export interface MessageBoxHandle extends HTMLDivElement {
@@ -115,6 +118,7 @@ export const MessageBox = forwardRef(
115118 jumpButtonBottomProps,
116119 jumpButtonBottomTooltipProps,
117120 jumpButtonTopTooltipProps,
121+ hasOuterScrollbar = false ,
118122 ...props
119123 } : MessageBoxProps ,
120124 ref : ForwardedRef < MessageBoxHandle | null >
@@ -433,7 +437,12 @@ export const MessageBox = forwardRef(
433437 role = "region"
434438 tabIndex = { 0 }
435439 aria-label = { ariaLabel }
436- className = { `pf-chatbot__messagebox ${ position === 'bottom' ? 'pf-chatbot__messagebox--bottom' : '' } ${ className ?? '' } ` }
440+ className = { css (
441+ 'pf-chatbot__messagebox' ,
442+ position === 'bottom' && 'pf-chatbot__messagebox--bottom' ,
443+ hasOuterScrollbar && 'pf-chatbot__messagebox--outer-scroll' ,
444+ className
445+ ) }
437446 ref = { messageBoxRef }
438447 { ...props }
439448 { ...( enableSmartScroll ? { ...smartScrollHandlers } : { } ) }
0 commit comments