Enzyme: simulate mouse event second button

Created on 14 Sep 2016  路  3Comments  路  Source: enzymejs/enzyme

how to simulate mouse event second button?

Most helpful comment

Just for reference, right mouse button triggers 'contextmenu' event, so this is also can be simulated as:

wrapper.simulate('contextmenu');

All 3 comments

Use the onContextMenu event handler.

Or you can pass the button value using simulates second argument:

wrapper.simulate('click', { button: 1 })

I'm going to close this issue as it reports nothing wrong with enzyme itself. Feel free to keep the conversation going however!

Just for reference, right mouse button triggers 'contextmenu' event, so this is also can be simulated as:

wrapper.simulate('contextmenu');

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benadamstyles picture benadamstyles  路  3Comments

heikkimu picture heikkimu  路  3Comments

dschinkel picture dschinkel  路  3Comments

aweary picture aweary  路  3Comments

abe903 picture abe903  路  3Comments