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

fix: ensure values not in options clear #835

Merged
merged 2 commits into from
Nov 23, 2023
Merged

Conversation

Skaiir
Copy link
Contributor

@Skaiir Skaiir commented Oct 11, 2023

Closes #817

@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Oct 11, 2023
@github-actions github-actions bot temporarily deployed to demo-817-options-value-restric October 12, 2023 11:09 Destroyed
Copy link
Contributor

@pinussilvestrus pinussilvestrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things to clarify, but in general, it looks like a nice direction to keep things clean 👍

Demo also works ✅

Comment on lines 24 to 26
onChange({
field,
value: values.filter(v => options.map(o => o.value).includes(v))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in the comment above having updates here might be unexpected. What would be the disadvantage of only sanitizing value here and not updating it directly? I guess it would lead to unexpected side effects as we never really clean things up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah because then you have a mismatch between the form and the actual state. So if you have lets say, a feel expression dependent on this value, it'll still evaluate despite the form not showing that value being selected.

@@ -0,0 +1,32 @@
import { useEffect } from 'preact/hooks';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no test added for this new behavior. Did I miss something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There be tests now

@Skaiir Skaiir force-pushed the 817-options-value-restriction branch from 6b82707 to e00d49d Compare November 23, 2023 07:16
@github-actions github-actions bot temporarily deployed to demo-817-options-value-restric November 23, 2023 07:17 Destroyed
@github-actions github-actions bot temporarily deployed to demo-817-options-value-restric November 23, 2023 07:30 Destroyed
@Skaiir Skaiir force-pushed the 817-options-value-restriction branch from 5e255a7 to 3017a1a Compare November 23, 2023 07:46
@github-actions github-actions bot temporarily deployed to demo-817-options-value-restric November 23, 2023 07:46 Destroyed
@github-actions github-actions bot temporarily deployed to demo-817-options-value-restric November 23, 2023 08:35 Destroyed
@github-actions github-actions bot temporarily deployed to demo-817-options-value-restric November 23, 2023 09:28 Destroyed
@pinussilvestrus
Copy link
Contributor

Thanks for the follow up 👍

@Skaiir Skaiir force-pushed the 817-options-value-restriction branch from 108240d to 4c17838 Compare November 23, 2023 10:19
@github-actions github-actions bot temporarily deployed to demo-817-options-value-restric November 23, 2023 10:20 Destroyed
@Skaiir Skaiir merged commit 8435f7a into master Nov 23, 2023
10 of 11 checks passed
@Skaiir Skaiir deleted the 817-options-value-restriction branch November 23, 2023 10:23
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants