Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I believe this cache busting is what's required to make the input work properly. Reference in slack: https://clojurians.slack.com/archives/C68M60S4F/p1716272709162819
Here's some workspace test code:
The underlying problem is the cachedValue was still being treated as valid even when it is no longer being represented in the model. So, whenever the model is updated externally the cache is "busted" and remains so until the user resumes control of the input by typing in it again.
Let me know if this change causes any issues - debugging dom inputs is troublesome and I'm not 100% confident that this addresses all edge cases.