Closed flyingL123 closed 4 years ago
Hi @flyingL123, that seemed like a reasonable and useful request (and wound up adding a net of only a few lines of code -- always a plus!) so I went ahead and added this under v5.2.4 (published now). Here is the documentation for how to turn off session storage:
https://github.com/ten1seven/what-input#persisting-inputintent-across-pages
Wow @ten1seven thanks so much for the quick turnaround on that!
This may not be the intended use for your library, but part of what I was using it for was to detect whether or not there has been some interaction with the page. For example, I have some event listeners that run on the window scroll event. However, I don't want those listeners running until the user interacts with the page.
I was using an older version of what-input, and was able to rely on the fact that
whatInput.ask()
would returnnull
orinitial
until the user actually interacted. However, after upgrading I see this is no longer the case since you are persisting the last input since a few versions ago: https://github.com/ten1seven/what-input#v510Is there any possibility of adding an option to disable this storage functionality?