Persisting text area values in localStorage

I have a table populated by a query and some filters that I apply with textelements. I'd like the values of them to persist beyond page refreshed, so I'm using localStorage.

I thought I'd be able to set the default value of the textelement field named titlefilter to {{ localStorage.values.titlefilter }} and then have a change event handler run this script on change: localStorage.setValue("titlefilter",titlefilterinput.value), however it seems a loop happens where the text field value updates whilst I'm typing in it, partially overwriting mid typing.

What am I doing wrong here? :thinking:

Hey @lox!

Happy to help! It sounds like the issue here is that localStorage is getting set as you type in the input rather than set after you are done writing the filter. Would setting this event handler to run on Submit/Blur or adding debounce to it work for your use case here?