react-notification-system
react-notification-system copied to clipboard
Feature Request: Keep notice viewable onMouseUp when text selected
One one clicks on the on the notification message (anywhere) it disappears. It is a good feature so ... But If the user needs to copy text they will drag making a selection then release the mouse. It would be good if the notification did not disappear before the Ctrl+C copy can take place. If you want to preserve the click to remove feature it may be possible to detect if there is a selection in the message and suppress. The X can still be used to close the message.
I believe that add more events to detect selection, copy/paste or mouse events would bloat the code.
A simple change would be add another property, something called dismissOnClick
to false
, so the notification would be only dismissed if user click on the X
icon. I'll take a look into this when I get a chance...
I think a prop like dismissOnClick
would open the door to having interactive content in the notification and would therefore be super useful.
As an example:
Come to think of it, one might be able to implement this with dismissible={false}
and then call removeNotificaiton(...)
from either a button / link in children
or an action button.