Apologies, I realized my question lacked context. ...
# htmx-general
f
Apologies, I realized my question lacked context. When updating a page in the background, if a form field has
hx-preserve
set, the field won't be replaced - however, if it currently has focus when the background update happens, the input element loses focus. For example, I have a page where a user could be typing away and when the page refreshes, the
hx-preserve
correctly leaves their entered text, but if they aren't paying attention whatever they are currently typing gets lost (since there is no element with focus). It just causes a lot of user annoyance, and sometimes page jumping (ie if they hit the space bar).