0

I'm using PrimeReact Message UI element and it automatically closed after a period of time determined by life property. How can I disable it to don't close automatically.

Here is the message element in my code:

message.current.show({ severity: 'error', content: 'Message Detail' });

I changed life property value to something like -1 and others but it didn't work for me.

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Mehdi Rahimi
  • 1,453
  • 5
  • 20
  • 31

1 Answers1

0

I found a not tidy solution in PrimeFaces forum about disabling auto close of toasts that is worked for messages too.

https://forum.primefaces.org/viewtopic.php?t=66087

set sticky property to true sticky: true stops auto close, even though I think it defined for another usage.

message.current.show({ sticky: 'true', severity: 'error', content: 'Message Detail' });
Mehdi Rahimi
  • 1,453
  • 5
  • 20
  • 31