ruyadorno/simple-slider

Could you pass `children` and `containerelement` to `onChange` and `onChangeEnd` to make the latter more useful?

WhereJuly opened this issue · 1 comments

There is not much one can do within onChange and onChangeEnd callbacks with only next and current indexes provided.

Just for my case I need to dynamically change the style attributes on the slides in addition to prop management the simple-slider provides. It is again just a tiny fix allowing for much wider customization.

This would only require the following change starting line 145:

        if (onChange) {
          onChange(actualIndex, nextIndex(), containerElem, imgs);
        }

And the similar for onChangeEnd on line 210.

👍 sounds like a great idea!