react-textarea-autocomplete icon indicating copy to clipboard operation
react-textarea-autocomplete copied to clipboard

onScroll handler for underlying textarea does not get propagated correctly

Open sriramvenkateshan opened this issue 4 years ago • 1 comments

If we add the prop onScroll={(e) => { /* do something here */ }}

the prop does not propagate correctly to the underlying textarea. I find that we can correct this if we add the following change in TextArea.jsx:

_onScrollHandler = (e: SyntheticFocusEvent<*>) => {
    const { onScroll } = this.props;
    if (onScroll) {
      e.persist();
      onScroll(e);
    }
    this._closeAutocomplete();
};

Can someone please help validate this change and add it ?

sriramvenkateshan avatar Sep 29 '21 21:09 sriramvenkateshan

sriramvenkateshan avatar Oct 04 '21 18:10 sriramvenkateshan