Skip to content

Commit

Permalink
fix(searchBox): show search button on ios and close when user hits se…
Browse files Browse the repository at this point in the history
…arch (algolia#1449)
  • Loading branch information
spoeken committed Oct 20, 2016
1 parent cbdec9b commit aac59d1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/widgets/search-box/search-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ function searchBox({
},
wrapInput(input) {
// Wrap input in a .ais-search-box div
const wrapper = document.createElement('div');
const wrapper = document.createElement('form');
wrapper.action = '#';
wrapper.onsubmit = function(e){
e.preventDefault();
document.activeElement.blur();
};

const CSSClassesToAdd = cx(bem(null), cssClasses.root).split(' ');
CSSClassesToAdd.forEach(cssClass => wrapper.classList.add(cssClass));
wrapper.appendChild(input);
Expand Down

0 comments on commit aac59d1

Please sign in to comment.