Skip to content

Commit 0647cde

Browse files
fballianoshyim
andauthored
RWD theme: Focus on the search field when clicking on the search button (#3095)
Co-authored-by: Shyim <[email protected]>
1 parent 3e093cf commit 0647cde

File tree

1 file changed

+7
-0
lines changed
  • skin/frontend/rwd/default/js

1 file changed

+7
-0
lines changed

skin/frontend/rwd/default/js/app.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,13 @@ $j(document).ready(function () {
719719
self.addClass('skip-active');
720720
elem.addClass('skip-active');
721721
}
722+
723+
if (target == '#header-search') {
724+
let searchInput = document.getElementById('search');
725+
if (searchInput) {
726+
searchInput.focus();
727+
}
728+
}
722729
});
723730

724731
$j('.skip-links').on('click', '#header-cart .skip-link-close', function(e) {

0 commit comments

Comments
 (0)