How do I autofocus to text input field in modal? Rails 7, Bootstrap 5
I have a search button in the top navbar. When the user clicks, a modal opens with a text input field. I want the keyboard focus to be automatically inside the text input field when the modal opens.
问答
阅读(3)