Skip to content

Dynamically change auto hide delay for specific notifications #9

Description

@marcus29200

Hi there,

I really enjoy this so far, I just wish it had this one feature! Which is to set a custom auto hide delay for each individual notification. I saw this suggestion in your "Whats Next" portion. And this would be something that would be of great use to me!

So something like this:
notifier.show({type: 'success', message: 'Hello', id: 'some_id', autoHide: 5000});
notifier.show({type: 'info', message: 'Go away fast', id: 'some_id_2', autoHide: 1000});

or even in notify:
notifier.notify('success', 'short message', 2000);

Thanks!

Activity

  1. mehmetgunacti commented on Jun 25, 2018

    @mehmetgunacti

    Hi,

    Thanks for such a great tool !

    I was looking for the same feature. Requirement is 'error' notifications should stay until the user clicks on them. All other notifications can / should disappear after a few seconds.

    Is this already included ? If not when can we expect this to be ready ?

  2. madmax25 commented on Jan 28, 2019

    @madmax25

    Need same flexibility.

  3. joebotha commented on Jan 28, 2019

    @joebotha

    This would be very useful for us also.

  4. SanjidHaque commented on May 12, 2020

    @SanjidHaque

    Try this

    this.notifierService.getConfig().behaviour.autoHide = false;
    or

    this.notifierService.getConfig().behaviour.autoHide = 2000;

  5. phil123456 commented on Oct 1, 2020

    @phil123456

    does not work for me, no matter the value I set, they disapear at the same time

    info('test',null); // 5000 being default value
    info('test',10000);
    

    my wrapper function

      info(message:string,time:number)
      {
      	let _time:number|false; // save default value
      	if(time)
    		{
    			_time = this.notifierService.getConfig().behaviour.autoHide;
    			this.notifierService.getConfig().behaviour.autoHide = time;
    		}
    
    		this.notifierService.notify('info', message);   
    
    		if(time)
    		{
    			this.notifierService.getConfig().behaviour.autoHide = _time;
    		} 	
      }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featureIndicates a feature or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions