File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 11import React , { ReactNode , useContext } from 'react' ;
2- import { Item , Section } from '../../../types' ;
2+ import { AutocompleteSectionConfiguration , Item , Section } from '../../../types' ;
33import { toKebabCase } from '../../../utils/format' ;
44import { CioAutocompleteContext } from '../CioAutocompleteProvider' ;
55import SectionItemsList from '../SectionItemsList/SectionItemsList' ;
@@ -30,7 +30,7 @@ const DefaultRenderResults: RenderResults = ({ sections }) =>
3030 key = section . indexSectionName ;
3131 break ;
3232 default :
33- key = section . indexSectionName ;
33+ key = ( section as AutocompleteSectionConfiguration ) . indexSectionName ;
3434 break ;
3535 }
3636
Original file line number Diff line number Diff line change 11import React , { ReactElement , useContext } from 'react' ;
2- import { Section } from '../../../types' ;
2+ import { AutocompleteSectionConfiguration , Section } from '../../../types' ;
33import SectionItem from '../SectionItem/SectionItem' ;
44import CustomSectionItem from '../SectionItem/CustomSectionItem' ;
55import { translate } from '../../../utils/helpers' ;
@@ -38,7 +38,7 @@ const DefaultRenderSectionItemsList: RenderSectionItemsList = function ({ sectio
3838 sectionTitle = section . displayName ;
3939 break ;
4040 default :
41- sectionTitle = section . indexSectionName ;
41+ sectionTitle = ( section as AutocompleteSectionConfiguration ) . indexSectionName ;
4242 break ;
4343 }
4444 }
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 HTMLPropsWithCioDataAttributes ,
1111 Item ,
1212 UseCioAutocompleteOptions ,
13+ AutocompleteSectionConfiguration ,
1314} from '../types' ;
1415import usePrevious from './usePrevious' ;
1516import { getItemPosition , getItemsForActiveSections } from '../utils/helpers' ;
@@ -230,7 +231,7 @@ const useCioAutocomplete = (options: UseCioAutocompleteOptions) => {
230231 sectionTitle = section . displayName ;
231232 break ;
232233 default :
233- sectionTitle = section . displayName || section . indexSectionName ;
234+ sectionTitle = ( section as AutocompleteSectionConfiguration ) . displayName || ( section as AutocompleteSectionConfiguration ) . indexSectionName ;
234235 break ;
235236 }
236237
You can’t perform that action at this time.
0 commit comments