All tags (also invalid or duplicate ones, but no empty strings) are send to parent in SmartNodeSelector
.
#124
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.
Before this commit, only valid, non-duplicate tags were sent to the parent component via the
selectedTags
argument in thesetProps
function call. This made it hard for parent components that updated states (and caused rerenderings) based on thesetProps
calls fromSmartNodeSelector
to keep the state of theSmartNodeSelector
's selection. For example, a click on the switch button in a tag could select a node which lacks the last sub node of the previous selection, causing the selected node to become invalid. However, the parent'ssetProps
function would be called withselectedTags
missing this now invalidated tag. If theSmartNodeSelector
component gets rerendered, this invalid selected tag would most likely get lost, causing incomprehensible behaviour. Sending all tags, even invalid ones, but as before only valid nodes and ids should help to overcome this potential problem.