algoliasearch-netlify icon indicating copy to clipboard operation
algoliasearch-netlify copied to clipboard

Feature request: adding autofocus option to Netlify frontend bundle

Open tinyapps opened this issue 2 years ago • 0 comments

If time and resources permit, please consider adding the autofocus option to Netlify's frontend bundle. At the moment, this is what I'm doing instead (improvements by JavaScript wizards welcome!):

<script>
      // Wait 250ms before setting focus on the input element
      setTimeout(function() {
      // Get the input element
      const input = document.querySelector('input');
      // Focus on the input element
      input.focus();
      }, 250);
</script>

tinyapps avatar Mar 20 '23 18:03 tinyapps