You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is unfortunately correct, and has come up before although I'm having trouble finding an issue in the Remix or React Router repos (it may have just been an internal Discord discussion though). Per the specpushState does not update the target element so :target styles only apply on full-document requests 😕
Thanks for the thorough response @brophdawg11, that makes sense. Hopefully the behaviour will change in the future - maybe with the navigation api. I'll have a look if I get a chance.
What version of Remix are you using?
1.16.1
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
https://codesandbox.io/p/sandbox/interesting-tu-u6gh0r?file=%2Fpackage.json%3A1%2C1
Try the above sandbox (probably best in fullscreen mode) with JS enabled & disabled. Note the difference
<Link to="/page#element-id" />
#element-id:target { /* my styles */ }
Expected Behavior
I would expect the behaviour to be identical with js enabled & disabled. So, I expect
:target
styles to be appliedActual Behavior
:target
styles are not always appliedThe text was updated successfully, but these errors were encountered: