Skip to content

Commit 99b7b69

Browse files
committed
fix breaking error, check for data prop to be set for Auto Complete
1 parent 794f21e commit 99b7b69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SearchInput/SearchInput.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export class SearchInput extends Component {
8888

8989
// create auto complete search items
9090
createAutoCompleteItems = data => {
91-
return data.length > 0 ? (
91+
return data && data.length > 0 ? (
9292
data.map((item, index) => {
9393
let classNames = 'fd-menu__item';
9494
if (index === 0) {
@@ -135,7 +135,7 @@ export class SearchInput extends Component {
135135
</div>
136136
</div>
137137
</div>
138-
{onAutoComplete ? (
138+
{data && onAutoComplete ? (
139139
<div
140140
className="fd-popover__body fd-popover__body--no-arrow"
141141
aria-hidden={!this.state.bShowList}

0 commit comments

Comments
 (0)