Closed MichaMican closed 2 years ago
I just realized it only happens if onScreen is set to true. I'm using a custom content:
store.addNotification({
content: <InlineMessage children={notification.message} type={notification.type}/>,
message: notification.message,
type: notification.type,
insert: "top",
container: "top-right",
animationIn: ["animate__animated", "animate__fadeIn"],
animationOut: ["animate__animated", "animate__fadeOut"],
dismiss: {
duration: ((notification.autoDismiss ?? 12) * 1000),
onScreen: true,
}
});
Seems to be skipped. I think I took the decision to either dismiss by duration or by click, not by both.
Will go fixed in the next release (don't know when that'll happen)
Demo page uses infinite duration (set to 0).
I don't recall publishing a fix for this but I just tested this and it works accordingly. The dismiss
property is an object where you can attach click
(boolean), the default for that is true, unless specified otherwise it should always be dissmisable by clicking since the clicking doesn't care whether it's onScreen
, custom content or anything else, it just looks for that property.
@MichaMican
If this is still an issue feel free to reopen it, I just didn't notice anything with it.
const object: iNotification = {
content: <h1>Hello</h1>,
type: "success" as any,
insert: "top" as any,
container: "top-right" as any,
animationIn: ["animate__animated", "animate__fadeIn"],
animationOut: ["animate__animated", "animate__fadeOut"],
dismiss: {
duration: 3000,
onScreen: true,
} as any
}
I used the code above to replicate your issue.
I'm using this library in my project.
Everything besides the autodismiss is working as expected. I tried to fix it but then i realized that it does not work on the demo page (where a autodismiss of 5000ms is set) as well. Is this a known issue or am I doing something wrong? I have imported the animate.css (v4) css file.