Skip to content

change listener #1

@AlexRevin

Description

@AlexRevin

I would suggest adding an option to fire event passed by props on handleDragEnd callback, rather than onChange.
In my specific case, there's quite a resource consuming real-time filtering process, which hangs the browser as there is a tremendous amount of events fired while dragging the slider.

This is how I see it:

 handleDragEnd(e) {
    document.removeEventListener('mousemove', this.handleDrag);
    document.removeEventListener('mouseup', this.handleDragEnd);
    if(this.props.onDragEnd) {
       this.props.onDragEnd({x: x, y: y});
    }
  }, 

In this case, it will be possible to omit the onChange callback, but use the onDragEnd only, which will fire only when dragging is finished.

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