Skip to content

React.addons.TestUtils.Simulate.scroll is not working with JSDOM #3846

@alansouzati

Description

@alansouzati

Hi, I'm trying to test the scroll event and I could not make the scroll event propagation to happen using TestUtils:

React.addons.TestUtils.Simulate.scroll(contentDiv, { deltaY: 500 });

The above code is never triggering the scroll function callback.
Then if I change the implementation to be something like this it works:

contentDiv.scrollTop = 500;

var evt = document.createEvent("HTMLEvents");
evt.initEvent("scroll", false, true);
contentDiv.dispatchEvent(evt);

Am I doing something wrong with the React TestUtils?
I've created a stackoverflow ticket for this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions