Skip to content

Unable to open logout menu #3024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
miketaylr opened this issue Oct 23, 2019 · 13 comments
Closed

Unable to open logout menu #3024

miketaylr opened this issue Oct 23, 2019 · 13 comments
Assignees

Comments

@miketaylr
Copy link
Member

STR:

  1. go to staging.webcompat.com
  2. log in
  3. click the "avatar V" menu thing in the top right

expected: dropdown opens
actual: nothing?

Doesn't reproduce on production, AFAICT.

@miketaylr
Copy link
Member Author

Actually, it seems to reproduce on production but only in Firefox? Working in production in Chrome, but not staging. I am very confused.

@miketaylr
Copy link
Member Author

In a private tab in Firefox, on production this is working as expected. Still confused.

@miketaylr
Copy link
Member Author

And now in a regular tab in Firefox on production this is working. But not on staging in Chrome. 👀

@miketaylr
Copy link
Member Author

Working in Safari... this might just be Chrome Canary bug territory.

@karlcow
Copy link
Member

karlcow commented Oct 23, 2019

Capture d’écran 2019-10-24 à 06 18 38

Firefox Nightly 72.0a1 (2019-10-22) (64-bit)
macOS 10.15 (19A602)

@ksy36
Copy link
Contributor

ksy36 commented Oct 23, 2019

This is not working for me in Firefox and Chrome, but only on this page https://webcompat.com/issues/new . Same on staging.

@ksy36
Copy link
Contributor

ksy36 commented Oct 23, 2019

Seems to be working only on the main page and not on internal pages :)

@miketaylr
Copy link
Member Author

Nice catch @ksy36! For some reason the event handler isn't getting set on the dropdown...

@karlcow
Copy link
Member

karlcow commented Oct 23, 2019

@karlcow
Copy link
Member

karlcow commented Oct 23, 2019

<li class="nav-item login js-login-link js-DropdownHeader">
  <button class="nav-button nav-link" aria-expanded="false" aria-label="My account">
    <img class="login-avatar-img" src="https://avatars0.githubusercontent.com/u/505230?v=4" alt="User Avatar">
    <svg class="icon nav-icon" viewBox="0 0 30 30" role="presentation" aria-hidden="true">
      <use xlink:href="#svg-chevron-right"></use>
    </svg>
  </button>
  <div class="nav-dropdown-wrapper">
    <ul class="dropdown">
      <li class="nav-dropdown-item">
        <a class="nav-link" href="/me">My Activity</a>
      </li>
      <li class="nav-dropdown-item">
        <a class="nav-link" href="/logout">Logout</a>
      </li>
    </ul>
  </div>
</li>

@miketaylr
Copy link
Member Author

We set the handler on the homepage here:

this.dropDownHandler = function() {
navDropDown.click(function() {
var $this = $(this);
$this.toggleClass("is-active");
$this.find("button").attr("aria-expanded", function() {
return $this.hasClass("is-active") ? "true" : "false";
});
});
// close dropdown if you click "outside"
$(document).on("click", function(e) {
if (!$(e.target).closest(navDropDown).length) {
navDropDown.removeClass("is-active");
navDropDown.find("button").attr("aria-expanded", "false");
}
});
};

@karlcow
Copy link
Member

karlcow commented Oct 23, 2019

220d5c3
This seems related. We moved navbar in its own file, out of homepage.js

@karlcow
Copy link
Member

karlcow commented Oct 23, 2019

This is fixing an issue introduced by #2896 for solving #2268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants