[whatwg] Proposing: "autoscroll" event
getify at gmail.com
Tue May 14 14:08:17 PDT 2013
> So, to that end, what about just adjusting the spec for the "hashchange"
> event to also fire when the page is initially loaded if the URL contains a
> fragment identifier (hash)? The other scenarios mentioned would already be
> covered by the "hashchange" event.
I think there's one critical thing that wouldn't be handled by this approach, and it was the primary reason I suggested a new event and not piggybacking on an existing one: I find the need to *cancel* (by calling `preventDefault()`) the auto-focus behavior at least as compelling as the ability to listen for or articifially fire it. There have been times this automatic behavior has been quite annoying because of accidential ID/hash overlap. There's also times when it would be nice to, UX-wise, let the user decide if they want to scroll or not.
More information about the whatwg