Closed gone closed 4 years ago
If you select $(":target"), and then call pushState with a hash, Although window.location.hash will agree with the url/pushState value, $(":target") will return the initial element. Example failing test here: https://github.com/gone/sizzle/blob/target-pushstate/test/unit/selector.js#L1217
My assumption is that pushState doesn't call onHashChange, while setting window.location.hash does, so an invalidation step is missed.
I'd be happy to submit a pr but I wasn't able to find where that cache is invalidated for the onHashChange event.
You have a long read in front of you: https://github.com/jquery/jquery/issues/2679
Closing per Dave's comment above.
If you select $(":target"), and then call pushState with a hash, Although window.location.hash will agree with the url/pushState value, $(":target") will return the initial element. Example failing test here: https://github.com/gone/sizzle/blob/target-pushstate/test/unit/selector.js#L1217
My assumption is that pushState doesn't call onHashChange, while setting window.location.hash does, so an invalidation step is missed.
I'd be happy to submit a pr but I wasn't able to find where that cache is invalidated for the onHashChange event.