Open jimmywarting opened 7 years ago
We generally don't define UI behavior. Apple in particular is usually pretty vocal about wanting to match platform conventions over everything else. You could try to convince Chrome though to change their behavior.
I think this might be an observable interop issue. See https://boom-bath.glitch.me/autofocus-range.html which prints selectionStart and selectionEnd after autofocus.
It seems this is just a Safari bug, as far as I can tell.
I was annoyed by how chrome puts the cursor at the beginning of this input element
Safari and Firefox did select the hole text which i found to be more useful
I think it could be useful if you could set a behavior with the attribute rather then it being a boolean attribute
autofocus="end"
puts the cursor at the endautofocus="start"
puts the cursor in the beginningautofocus="mark"
highlight/marks the value for easy copy/cut/replace/navigate with arrow keysautofocus
default behavior