-
Bug reportI cannot use autofocus by using next.js Describe the bugI want the page to autofocus on an input element when it loads, but it doesn't work To ReproduceSteps to reproduce the behavior, please provide code snippets or a repository:
<input type="text" autoFocus />
Expected behaviorAutofoucs input when page was loaded. ScreenshotsSystem information
"dependencies": {
"next": "9.5.3",
"react": "16.13.1",
"react-dom": "16.13.1"
}
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Any update on this issue? |
Beta Was this translation helpful? Give feedback.
-
Maybe posting this as an issue (not a discussion) will draw more attention? |
Beta Was this translation helpful? Give feedback.
-
This one tripped me up - when using |
Beta Was this translation helpful? Give feedback.
This one tripped me up - when using
next dev
, it wasn't working as I'd expect (must be due to the browser not thinking it's a fresh page load with Fast Refresh, maybe?). When I rannext build && next start
and also when deployed to prod, it worked!