Navigation: Click handler correctly handles absolute URL with hash

(cherry picked from commit bdfe15d33c48b40473c32103f0e3acaa8b939834)

Closes gh-7632
Fixes gh-5759