Closed andrea-ligios closed 3 years ago
Hi @andrea-ligios
The only way I can come up with is you handling the scroll event and dismissing the cookie banner from outside but I realise it's not optimal:
import CookieBanner from 'react-cookie-banner';
import { BannerContent } from 'react-cookie-banner';
handleScroll = () => {
if (this._dismissCookieBanner) {
this._dismissCookieBanner();
}
}
<Scrollbars onScroll={this.handleScroll} {...}>
<CookieBanner>
(onAccept) => {
this._dismissCookieBanner = onAccept;
return <BannerContent onAccept={onAccept} {...} />
}
</CookieBanner>
</Scrollbars>
NOTE: I haven't tested it so I'm not sure it works correctly
Hi, I've noticed that using React-Cookie-Banner along with React-Custom-Scrollbars the on-scroll dismission doesn't work, most likely because the latter is handling the scrolling event, preventing CookieBanner to be aware of what's going on. Do you think is there a way to make them work together?