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.
Here is a possible change to implement a new keepInputValues option while keeping all the old input handling behavior the same
With this setting turned on we are able to optimize the performance of all node updates where there are no innerHTML changes as we can just skip morphing. Before this was not possible because the old sync input value routine would apply changes to reset input and textarea user input state even when there are no no actual node changes to morph. But with the new keepInputValues option this is not an issue anymore. It does mean this currently has to be opt in to not break things. It may be possible to remove the two old input preservation config flags as they may not be needed in a future version as this option mostly replaces their need.
The idea with the keepInputValues is to just skip forcing syncing the input values logic we have now and just now detect if the default value supplied is different than the last one and only update the users input value if this changes. This allows you to push out new identical form updates that will morph without losing any user input. However it has one big downside and this is that forms will not reset on morph so after form submit if you return the same blank form it will retain the old existing input values which may not be what is expected. This is why it is currently an opt in config value so it won't break existing use cases.