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
The comparison between window.location.pathname will always fail if the the to contains a query string, for example if the to is: /example/?id=1234#foo, the comparison will be between pathname which is only /example/ and everything before the hash /example/?id=1234, which will fail.
if (window.location.pathname === withPrefix(anchorPath)) {
The text was updated successfully, but these errors were encountered:
Undistraction
changed the title
Comparison Shouldn't Fail When 'To' Contains a Query
Comparison Shouldn't Fail When 'To' Contains a Query String / Search
Jan 11, 2023
The comparison between
window.location.pathname
will always fail if the theto
contains a query string, for example if theto
is:/example/?id=1234#foo
, the comparison will be betweenpathname
which is only/example/
and everything before the hash/example/?id=1234
, which will fail.Code here
The text was updated successfully, but these errors were encountered: