react-notification-system icon indicating copy to clipboard operation
react-notification-system copied to clipboard

Feature Request: Keep notice viewable onMouseUp when text selected

Open jcalfee opened this issue 8 years ago • 2 comments

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.

jcalfee avatar Jul 17 '15 14:07 jcalfee

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...

igorprado avatar Jul 21 '15 18:07 igorprado

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: exception-notification

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.

tiffon avatar Mar 11 '17 23:03 tiffon