Skip to content

Commit 8713eb5

Browse files
committed
Fix focus not returning correctly after mobile search dialog.
1 parent ec3481e commit 8713eb5

File tree

1 file changed

+4
-3
lines changed
  • digitransit-component/packages/digitransit-component-autosuggest/src

1 file changed

+4
-3
lines changed

digitransit-component/packages/digitransit-component-autosuggest/src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ class DTAutosuggest extends React.Component {
436436
renderMobileSearch: false,
437437
value: this.props.value,
438438
});
439-
if (this.props.isMobile) {
439+
if (this.props.isMobile && this.state.renderMobileSearch) {
440440
this.closeMobileSearch();
441441
}
442442
};
@@ -504,7 +504,7 @@ class DTAutosuggest extends React.Component {
504504
) {
505505
this.props.focusChange();
506506
}
507-
if (this.props.isMobile) {
507+
if (this.props.isMobile && this.state.renderMobileSearch) {
508508
this.closeMobileSearch();
509509
}
510510
},
@@ -561,7 +561,7 @@ class DTAutosuggest extends React.Component {
561561
this.props.id,
562562
);
563563
}
564-
if (this.props.isMobile) {
564+
if (this.props.isMobile && this.state.renderMobileSearch) {
565565
this.closeMobileSearch();
566566
}
567567
if (
@@ -821,6 +821,7 @@ class DTAutosuggest extends React.Component {
821821
this.onSuggestionsClearRequested();
822822
},
823823
);
824+
this.input.focus();
824825
};
825826

826827
keyDown = event => {

0 commit comments

Comments
 (0)