Customer error messages disappear too fast

We have noticed that our magento 2 installation has a problem with error messages disappearing too quickly. We found a temporary description of the issue on stackexchange:

That in turn led to a “fix” on github, mentioned here:

Theoretically, this should work, but it has two problems with it:

  1. It doesn’t appear to honor the correct timeout, regardless of what value you put in the setTimeout function
  2. It doesn’t automatically move a user’s scroll to the error on subsequent errors.

This is extremely annoying to our users, because if they enter a credit card and it rejects the card because of address verification, it is very difficult for them to see the error on mobile. Even on desktop, the message disappears too quickly for them to make sense of what is happening.

Is there a simple fix for this, or would it require extensive customization?

I do not know why to hide an error message at all.
I recommend to prevent such messages from being hidden.

That’s fantastic! What a simple fix, thank you Dmitry!