This seems to have caused the unwanted effect of not focusing the field in Mobile Safari
Looks like it regressed in https://github.com/basecamp/fizzy/commit/250935530f86eb628d6b54ec6b7212dac9e76f8b. Let's see if we can get focus in Safari without sacrificing select in other browsers by simply moving the nextFrame() call
This commit is contained in:
@@ -65,8 +65,8 @@ export default class extends Controller {
|
||||
|
||||
const autofocusElement = element.querySelector("[autofocus]")
|
||||
|
||||
await nextFrame()
|
||||
autofocusElement?.focus()
|
||||
await nextFrame()
|
||||
autofocusElement?.select()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user