Closed illandril closed 1 year ago
I would like to work on this if someone haven't taken this already
@illandril not sure to understand well. You can pass false
to closeButton
props if you want to hide it. see https://fkhadra.github.io/react-toastify/use-a-custom-close-button-or-remove-it/#remove-it
I must have typo'd closeButton
before when trying to use it as an option for a toast instead of on the container, because I had tried that and it didn't work before.
I've tried it again and it is working, so that works as a "good enough" solution.
It would still be nice to have it passed in as a prop to closeButton, so I only need to set closeButton on the container instead of needing to override it for every toast that has an autoClose... but that is definitely just a low-priority "nice to have".
@illandril you can already pass closeButton
to the container :) and override it by toast when needed.
What you can't do, and what I was asking for, is a way to set a closeButton and autoClose: 5000
on the container, and then set only autoClose
(as opposed to both autoClose
and closeButton
) on the toasts as needed, having the close button show if and only if autoClose
is false.
The benefits being...
Do you want to request a feature or report a bug? Feature
What is the current behavior? When
closeButton
is a function, the values passed in arecloseToast
,type
, andtheme
.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your CodeSandbox (https://codesandbox.io/s/new) example below:
What is the expected behavior?
closeButton
is also passed theautoClose
value.We'd like this value so we can hide the close button in situations where the toast will auto close, so alternative solutions that allow for that would also be acceptable (ex. a new "hideCloseButtonOnAutoClose" prop).
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? All.