Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Fix issue with page refreshing on auth box open
Browse files Browse the repository at this point in the history
This was really difficult to debug and I couldn't reproduce it but suspected
it was something to do with this <a> tag missing a href.

Greg figured it out yesterday that it was when you start on another page of ReadMe
then navigate to a reference page, this issue occurs.

I'm not 100% sure of the cause of the bug, i'm guessing it's something to do with
the pjax library highjacking all clicks on anchors, and because this is missing
an href, it gets highjacked instead of delegating to React.

I've demoed this working to Marc over slack.
  • Loading branch information
domharrington committed Nov 7, 2018
1 parent c5e76ee commit 24d003d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/api-explorer/src/AuthBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class AuthBox extends React.Component {
return (
<div className={classNames('hub-auth-dropdown', 'simple-dropdown', { open })}>
{
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a href="" className="icon icon-user-lock" onClick={toggle} />
// eslint-disable-next-line jsx-a11y/anchor-has-content, jsx-a11y/href-no-hash
<a href="#" className="icon icon-user-lock" onClick={toggle} />
}
<div className="nopad">
<div className="triangle" />
Expand Down

0 comments on commit 24d003d

Please sign in to comment.