Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All tags (also invalid or duplicate ones, but no empty strings) are send to parent in SmartNodeSelector. #124

Conversation

rubenthoms
Copy link
Collaborator

Before this commit, only valid, non-duplicate tags were sent to the parent component via the selectedTags argument in the setProps function call. This made it hard for parent components that updated states (and caused rerenderings) based on the setProps calls from SmartNodeSelector to keep the state of the SmartNodeSelector'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's setProps function would be called with selectedTags missing this now invalidated tag. If the SmartNodeSelector 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.

@rubenthoms rubenthoms changed the title All tags (also invalid or duplicate ones) are send to parent in SmartNodeSelector. All tags (also invalid or duplicate ones, but no empty strings) are send to parent in SmartNodeSelector. May 4, 2021
@rubenthoms rubenthoms force-pushed the adjust-selected-tags-in-smartnodeselector branch from c6f53c8 to 51b64dc Compare May 5, 2021 14:17
@rubenthoms rubenthoms merged commit 5bc93c3 into equinor:master May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants