Skip to content

Scroll wheel hits preventDefault if canScrollY is false #31

@lnist

Description

@lnist

If the ScrollArea is big enough to contain contents vertically without scrolling, then the scroll wheel stops working.
It seems handleWheel invokes composeNewState which returns a newState without topPosition defined.
Since this.state.topPosition === 0, then
if(this.state.topPosition !== newState.topPosition || this.state.leftPosition !== newState.leftPosition){
e.preventDefault();
}
invokes preventDefault.

Either the newState should have topPosition defined, or its definition should be checked, like:
if ( (r.topPosition && this.state.topPosition!==r.topPosition)||(r.leftPosition && this.state.leftPosition!==r.leftPosition)) {
e.preventDefault();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions