Skip to content
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

Feature Request: Support auxclick event (onAuxClick) #8529

Closed
foray1010 opened this issue Dec 8, 2016 · 7 comments · Fixed by #11571
Closed

Feature Request: Support auxclick event (onAuxClick) #8529

foray1010 opened this issue Dec 8, 2016 · 7 comments · Fixed by #11571

Comments

@foray1010
Copy link

Version 15.4.1

As starting Chrome 55, there is a new event auxclick to handle middle click, and click doesn't trigger by middle click anymore
https://developers.google.com/web/updates/2016/10/auxclick

@foray1010 foray1010 changed the title Feature Request: Support auxclick event Feature Request: Support auxclick event (onAuxClick) Dec 8, 2016
foray1010 added a commit to foray1010/Popup-my-Bookmarks that referenced this issue Jan 20, 2017
@jkillian
Copy link

jkillian commented Feb 2, 2017

Middle-clicking in our app broke as of Chrome 55 because of this. Would appreciate auxclick support in order to make it work correctly again!

@ostigley
Copy link

ostigley commented Apr 5, 2017

I found the same problem, but came up with the following work around, using refs.

In the following, this.title and this.image are refs on the <h4> and <img> components.

componentDidMount() {
    const isChrome = !!window.chrome && !!window.chrome.webstore;

    const auxclick = element => element.addEventListener('auxclick', () =>
      window.open(`/stories/${this.props.storyId}/show`, '_blank')
    );

    if (isChrome) {
      auxclick(this.title);
      auxclick(this.image);
    }
  }

Obviously you can put whatever you want in your addEventListerner callback. It's working really well so far. 🌭

@jquense
Copy link
Contributor

jquense commented Jun 7, 2017

jeez this is annoying.

@nhunzaker @sebmarkbage @aweary Should we "fix" this in an event plugin or simply add the new event? I'm guessing that middle button clicks are explicitly specced so this doesn't count as breaking, but jeez

@mk0x9
Copy link

mk0x9 commented Nov 15, 2017

B-bump. It would be really nice to have auxclick in react...

@sebmarkbage
Copy link
Collaborator

@jquense This came up with regard to active/passive events too. If an intervention came as a result of something that isn't common in the React ecosystem, then we can probably "fix" it. However, this seems like something that would be relevant to us. So we should probably follow along and add another event?

@nhunzaker
Copy link
Contributor

Fixed by #11571

@justingrant
Copy link
Contributor

FYI, if anyone else gets tripped up (like I was) because Safari still sends click instead of auxclick in response to a middle-button click, here's a workaround. Hope this is useful for the next victim: https://stackoverflow.com/questions/59556495/how-to-run-common-code-before-all-onclick-handlers-in-a-react-app-to-work-arou

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

Successfully merging a pull request may close this issue.

9 participants