Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG - removeOnHoverTimeOut not applied properly #227

Closed
Vadorequest opened this issue Feb 17, 2019 · 4 comments
Closed

BUG - removeOnHoverTimeOut not applied properly #227

Vadorequest opened this issue Feb 17, 2019 · 4 comments
Labels

Comments

@Vadorequest
Copy link

This is either a bug or a misunderstanding of the removeOnHoverTimeOut.

      // Display the message 4s per error, so that the user has time to see all missing fields (UX)
      const timeout = fields.length * 4000;

      toastr.error(title, {
        position: 'bottom-left', // Because in production, in the iframe, we don't see them if they're on top
        timeOut: timeout,
        removeOnHover: true,
        removeOnHoverTimeOut: timeout,
        component: <p dangerouslySetInnerHTML={{ __html: message }} />,
        closeOnToastrClick: false,
      });

I'm setting timeOut and removeOnHoverTimeOut to accomplish the following behaviour:

  1. Validation error (form) happen, display a toast
  2. Toast should be displayed 4 seconds per error field
  3. If user hovers on the toast, the toast should keep being displayed, allow error message copy, timeout should pause during hovering (provide enough time for user to read the error message and figure out what's wrong without stress)
  4. If user has hovered and stops hovering then timeout should either use the removeOnHoverTimeOut value (basically reset the timeout), or use the last timeout value before pausing (timeout goes back to the value it was set before it was paused)

Current behaviour:

  1. Validation error (form) happen, display a toast
  2. Toast is be displayed 4 seconds per error field
  3. If user hovers on the toast, the toast keep being displayed, allows error message copy, timeout does pause during hovering
  4. If user has hovered and stops hovering then timeout goes wild and is set back to 1000 instead of the removeOnHoverTimeOut value and the message gets hidden too fast
@thibaultvdb-incerta
Copy link

Is this issue already being cared off? I'm having the same problem at the moment.

@Vadorequest
Copy link
Author

I doubt anyone addressed this issue yet @thibaultvdb-incerta :)

It doesn't block me since I used a workaround and didn't need a particular behaviour, but it may be more problematic in your case.

@thibaultvdb-incerta
Copy link

@Vadorequest What workaround did you use then, if I may be so curious? :D

@Vadorequest
Copy link
Author

I mostly ignored the UX issue, if the use hovers on the toast then it'll hide too fast but can't do much about it without digging into the bug itself.

const timeout = fields.length * 4000;

      toastr.error(title, {
        position: 'bottom-left', // Because in production, in the iframe, we don't see them if they're on top
        timeOut: timeout,
        removeOnHover: true,
        removeOnHoverTimeOut: timeout,
        component: <p dangerouslySetInnerHTML={{ __html: message }} />,
        closeOnToastrClick: false,
      });

I'm contented with the following, wish it'd be better but it ain't that critical in my case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants