This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
if dismissOnScroll at false, the click on the close button do not close the banner #16
Labels
Comments
I'm not sure I understand. Can you describe the steps to reproduce this issue and the expected outcome? |
if you put the props dismissOnScroll at false, the close button does not work anymore |
solved by adding a dummy setState at the end of the onAccept function |
oh I see. Yes, there should be either a dummy Good catch! I'll fix it soon |
I'm in favour of the setState :) |
calling an empty |
fair enough :) |
and why not use something like: getInitialState: function(){
return {
...
displayBanner: this.hasAcceptedCookies()
...
};
},
onAccept: function() {
...
this.setState({
displayBanner: true;
})
},
getBanner: function() {
...
if( this.hasAcceptedCookies() ) {
return null;
}
...
},
render: function() {
var displayBanner = this.state.displayBanner;
....
return displayBanner ? this.getBanner();
} |
@F4b1n0u fixed and released as 0.0.13. Thanks for the report! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
it's the setState() into removeOnScrollListener who trigger the getBanner into the render
witch make disappear it once click on the close button.
but if a props dismissOnScroll at false, listeningScroll is at false as well
and that skips the removeOnScrollListener call
so no render, so the banner do not disappear.
The text was updated successfully, but these errors were encountered: