Skip to content

Toastr settings are not respected on the first call #404

@xabikos

Description

@xabikos

I am using toastr from npm with webpack. The strange behavior is that the settings that I am applying globally are not respected on the first notification but it's fine on the rest. More specifically my code looks like the following:

import toastr from 'toastr';

toastr.options = {
  closeButton: false,
  newestOnTop: false,
  progressBar: false,
  positionClass: 'toast-bottom-right',
  preventDuplicates: false,
  onclick: null,
  showDuration: 300,
  hideDuration: 1000,
  timeOut: 5000,
  extendedTimeOut: 1000,
  showEasing: 'swing',
  hideEasing: 'linear',
  showMethod: 'fadeIn',
  hideMethod: 'fadeOut',
};
const NotificationsService = {
  success(message, title) {
    toastr.success(message, title);
  },
};
export default NotificationsService;

I want all the notifications to be shown on the bottom right corner. On the first time the notification is shown to the top right corner and afterwards everything is fine. Any idea why this happens?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions