diff --git a/demo/src/Components/SearchSuggest/page.json b/demo/src/Components/SearchSuggest/page.json index c089b487..d9122de7 100644 --- a/demo/src/Components/SearchSuggest/page.json +++ b/demo/src/Components/SearchSuggest/page.json @@ -15,6 +15,7 @@ "type": "page", "title": "Example page 2", "description": "Some basic example page 2 with short description.", + "section": "Example section", "link": "/en/data-visualization/step-by-step/charts/example-2" }, { diff --git a/src/components/SearchSuggest/SearchInput.tsx b/src/components/SearchSuggest/SearchInput.tsx index 839438d4..371fc7f2 100644 --- a/src/components/SearchSuggest/SearchInput.tsx +++ b/src/components/SearchSuggest/SearchInput.tsx @@ -23,20 +23,14 @@ const b = block('dc-search-input'); export const SearchInput = memo( forwardRef((props, ref) => { - const { - id, - text, - size, - autoFocus, - placeholder, - endContent, - onBlur, - onFocus, - onUpdate, - onKeyDown, - className, - controlProps, - } = props; + const {id, text, size, autoFocus, placeholder, endContent, className, controlProps} = props; + + const events = { + onUpdate: props.onUpdate, + onKeyDown: props.onKeyDown, + onFocus: props.onFocus, + onBlur: props.onBlur, + }; return ( = (item) => { case SuggestItemType.Page: return ( - {item.title} + + {item.section ? item.section : item.title} + + {item.section && {item.title}} {item.description} ); diff --git a/src/components/SearchSuggest/index.scss b/src/components/SearchSuggest/index.scss index aee5f46d..11003f68 100644 --- a/src/components/SearchSuggest/index.scss +++ b/src/components/SearchSuggest/index.scss @@ -60,6 +60,7 @@ &-title, &-description, + &-subtitle, &-breadcrumbs > * { display: block; overflow: hidden; diff --git a/src/components/SearchSuggest/types.ts b/src/components/SearchSuggest/types.ts index c6e9ac7d..9f05ddd6 100644 --- a/src/components/SearchSuggest/types.ts +++ b/src/components/SearchSuggest/types.ts @@ -23,6 +23,7 @@ export interface SearchSuggestPageItem extends SearchSuggestBaseItem { title: string; link: string; description?: string; + section?: string; breadcrumbs?: BreadcrumbItem[]; }