denoland / fresh

The next-gen web framework.
https://fresh.deno.dev
MIT License
12.17k stars 623 forks source link

bugfix: autofocus didn't work in example Input component #2274

Open skybrian opened 7 months ago

skybrian commented 7 months ago

Disabled elements can't receive focus. If autofocus is requested, we shouldn't disable the input element on startup, or it will have no effect.

The easiest way to fix it is to leave the input element enabled. However, I'm not sure what the other consequences of that are.

(Note: this is how I fixed it in my app, but I haven't tested this patch.)