rommguy/react-custom-scroll

'keepAtBottom' not working when onClick event is triggered

Closed this issue · 2 comments

it seems that keepAtBottom="true" is not working when onClick event is triggered. namely, when the content is dynamic and changes as a result of onClick invocation.

as a workaround - using event.stopPropagation(); in onClick fixed it.

<CustomScroll>
  {list.map(item => (<div onClick={/* do something that causes `list` to re-render */}></div>) )}
</CustomScroll>
sag1v commented

Can you post a working example that reproduce the issue?
it is working for me as well as in this example.

@sag1v I can reproduce it. I will commit a failing test tomorrow, hopefully with a solution