# from href="#" occasionally breaking navigation

(Daniel Ritchie) #1

In I’m getting this ethereal problem. When a notification comes in, and the notification count hyperlink is up, atop the notification menu tab, the hyperlink will sometimes append # to the end of location.href, and this will thoroughly break in-page navigation until the # is cleared manually from the browser location bar.

I’m unable to pin it down further, and haven’t reproduced the trigger to enter that condition consistently. I haven’t seen any other hyperlink in Discourse do this: only <a class=“badge-notification”>

When in the error condition, the badge-notification hyperlink misbehaves anywhere I browse, but nothing else in <ul class=“icons”> breaks. When not in this condition, <a class=“badge-notification”> works normally, no matter where I browse. I feel like something isn’t firing onclick or onmouseup that should be, in that one case.

For what it’s worth, the error condition triggers window.onhashchange with window.location.hash == “”;


I’ve narrowed the trigger condition a bit. It occurs most consistently on notifications sent to the client via the ember.js polling mechanism while the app is in-session, idle on some arbitrary page. The error doesn’t always occur in this case, but when it does, that seems to be it in my observation.

(Sam Saffron) #2

I fixed this issue last week, the repro was

  1. Wait for new blue notification.
  2. Click on the new blue circle.

Event was not bound correctly

(Sam Saffron) #3