@@ -10,7 +10,8 @@ import {
1010 MenuToggleElement ,
1111 Select ,
1212 SelectList ,
13- SelectOption
13+ SelectOption ,
14+ Tooltip
1415} from '@patternfly/react-core' ;
1516import { FilterIcon , SortAmountDownIcon } from '@patternfly/react-icons' ;
1617
@@ -141,13 +142,15 @@ export const ChatbotHeaderTitleDemo: FunctionComponent = () => {
141142 isLoading = { isLoading }
142143 searchActionStart = {
143144 showSearchActionStart ? (
144- < Button
145- variant = "control"
146- aria-label = "Filter options"
147- // eslint-disable-next-line no-console
148- onClick = { ( ) => console . log ( 'Filter button clicked' ) }
149- icon = { < FilterIcon /> }
150- />
145+ < Tooltip content = "Filter options" aria = "none" aria-live = "off" >
146+ < Button
147+ variant = "control"
148+ aria-label = "Filter options"
149+ // eslint-disable-next-line no-console
150+ onClick = { ( ) => console . log ( 'Filter button clicked' ) }
151+ icon = { < FilterIcon /> }
152+ />
153+ </ Tooltip >
151154 ) : undefined
152155 }
153156 searchActionEnd = {
@@ -157,23 +160,26 @@ export const ChatbotHeaderTitleDemo: FunctionComponent = () => {
157160 isOpen = { isSortSelectOpen }
158161 selected = { selectedSort }
159162 onSelect = { onSortSelect }
163+ shouldFocusToggleOnSelect
160164 onOpenChange = { ( isOpen ) => setIsSortSelectOpen ( isOpen ) }
161165 toggle = { ( toggleRef : React . Ref < MenuToggleElement > ) => (
162- < MenuToggle
163- ref = { toggleRef }
164- onClick = { ( ) => setIsSortSelectOpen ( ! isSortSelectOpen ) }
165- isExpanded = { isSortSelectOpen }
166- variant = "plain"
167- aria-label = { `${ sortLabels [ selectedSort ] } , Sort conversations` }
168- icon = {
169- < SortAmountDownIcon
170- style = { {
171- transform :
172- selectedSort === 'oldest' || selectedSort === 'alphabetical-asc' ? 'scaleY(-1)' : 'none'
173- } }
174- />
175- }
176- />
166+ < Tooltip aria = "none" aria-live = "off" content = { `Sort - ${ sortLabels [ selectedSort ] } ` } >
167+ < MenuToggle
168+ ref = { toggleRef }
169+ onClick = { ( ) => setIsSortSelectOpen ( ! isSortSelectOpen ) }
170+ isExpanded = { isSortSelectOpen }
171+ variant = "plain"
172+ aria-label = { `${ sortLabels [ selectedSort ] } , Sort conversations` }
173+ icon = {
174+ < SortAmountDownIcon
175+ style = { {
176+ transform :
177+ selectedSort === 'oldest' || selectedSort === 'alphabetical-asc' ? 'scaleY(-1)' : 'none'
178+ } }
179+ />
180+ }
181+ />
182+ </ Tooltip >
177183 ) }
178184 >
179185 < SelectList >
0 commit comments