rsuite icon indicating copy to clipboard operation
rsuite copied to clipboard

Do not close the notification while the mouse is over it.

Open nasatome opened this issue 5 years ago • 1 comments

What problem does this feature solve?

Do not close the notification while the mouse is over the element. something similar to what the pNotify library does.

https://sciactive.com/pnotify/

PNotify.notice({
  title: 'No Mouse Reset Notice',
  text: 'I don\'t care if you move your mouse over me, I\'ll disappear when I want.',
  mouseReset: false
});

they handle it as Mouse Reset, this is useful for notifications that you want to last a short time, but maybe, the user is interested in reading them and they have a lot of text, so while the mouse is over it, the notification will not disappear.

What does the proposed API look like?

interface NotificationProps {
  title: React.ReactNode;
  description: React.ReactNode;
  duration?: number;
  placement?: string;
  className?: string;
  style?: React.CSSProperties;
  top?: number;
  bottom?: number;
  key?: string;
  onClose?: () => void;
  mouseReset?: boolean;
}


  Notification.open({
    title: 'Notify',
    duration: 5000,
    description: <Paragraph style={{ width: 320 }} rows={35} />
    mouseReset: true
  });

nasatome avatar Feb 26 '21 00:02 nasatome

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 16 '22 09:04 stale[bot]