Open
Conversation
Collaborator
Author
|
Found this issue #27 that has a similar suggestion and need for this same feature. There is a suggestion in this issue to re-write the sync input code and remove and simplify most of the logic to handle situations where inputs have been changed by end users but not the attributes themselves. But this is likely a breaking change for some users so would have to be added as an option. But my solution here also seems to cover their use case well and I think is less likely to risk causing issues as my change allows you to override all input value swapping if this is the requirement instead of tring to do a smarter optional attribute comparision. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 new feature we can add. We already have support to ignore the value of the active element. This existing feature allow you to morph say a form with inputs to a new state but it will not update the contents of the item the user is currently focused on and entering input into. However for all other inputs in the same form their current values will need to passed back to the server and returned as they are in the response that gets morphed in so that the state of the other inputs can be preserved. This probably works well for most cases. But it would also be nice to support a more generic value preserving option like this IgnoreValue option where instead it can preserve ALL inputs, checkboxes and textarea's with the current DOM entry state. I found this feature mainly useful when testing form replacement and mutations on the client side as I didn't have a server interaction to submit and recreate the input values. I do not know if there is wider demand for this feature outside of this so feel free to ignore and close this PR