question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

click not firing mouseover event

See original GitHub issue

Current behavior:

I trigger some react-contextify menu with .trigger('contextmenu') My menu is displaying OK

image

Then I select the div element where an onClick event is attached. cy.get('.react-contexify__item').debug().click();

I tried to use also “force: true” as an option.

But my action is not triggered. Nothing happens.

With debug() option activated, I trigger manually the click() event and my Material UI dialog is displayed.

------------------------ Debug Info ------------------------
cypress_runner.js:63678 Command Name:     get
cypress_runner.js:63678 Command Args:     [".react-contexify__item"]
cypress_runner.js:63678 Current Subject:  jQuery.fn.init [div.react-contexify__item, prevObject: jQuery.fn.init(1), context: document, selector: ".react-contexify__item"]
subject.click()
MegaTrendPage.jsx:316 hello!
jQuery.fn.init [div.react-contexify__item, prevObject: jQuery.fn.init(1), context: document, selector: ".react-contexify__item"]

Source for div menu is like this:

  return (
      <div
        className={cssClasses}
        style={style}
        onClick={this.handleClick}
        role="presentation"
      >
        <div className={styles.itemContent}>{children}</div>
      </div>
    );

Desired behavior:

I trigger click event and dialog is shown…

Versions

Cypress Version used : 3.1.3 Chrome 70.0.3538.110 React 16.6.3 react-contexify : 3.0.3

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kucebcommented, Dec 17, 2018

@jkeruzec I was able to reproduce, thank you. We are aware of this issue because we do not yet send mouseover/pointerover events during a click.

We’ll have a fix in either 3.1.3 or 4.0

in the meantime, you can do this:

cy.get('.react-contexify__item__data')	
  .trigger('mouseover').click()
  .then(() => {
	 expect(stub).to.be.calledWith('Hello bug !');
  });
0reactions
cypress-bot[bot]commented, Oct 23, 2019

Released in 3.5.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mouseover event is not firing on element on which written
I found the solution. I used mouseenter event instead of mouseover and it worked.
Read more >
Mouseover event not firing correctly - jquery - Stack Overflow
I am trying to display a tool-tip alert from a mouse over event on a button. however, what ...
Read more >
Element: mouseover event - Web APIs | MDN
The mouseover event is fired at an Element when a pointing device (such as a mouse or trackpad) is used to move the...
Read more >
How to trigger onClick from HTML button's mouseOver event
Hook the onmouseover event of the button by attaching the change() function to it. · From the change() method, get reference to the...
Read more >
Moving the mouse: mouseover/out, mouseenter/leave
The mouseover event occurs when a mouse pointer comes over an element, and mouseout – when it leaves. These events are special, because...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found