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: Use current values to populate DataAutocomplete options, not just static initial values #4216

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Jan 28, 2025

What's the problem?

The DataAutocomplete component is not aware of the current status of the form, just the initial status. As I enter new values across fields, I should be able to reference and select them within my component. Raised here as an issue on OSL Slack - https://opensystemslab.slack.com/archives/C5Q59R3HB/p1737660734834029?thread_ts=1737640916.451959&cid=C5Q59R3HB

What's the solution?

Rather than just entering the formik.initialValues as the schema, dynamically pass the current formik.values. As I enter new values across the current component, I can see this change reflected across all my DataAutocomplete components.

To test..

Please watch video in Slack thread referenced above for context

  • I can open a new node (e.g. question or checklist)
  • As I enter data values, each autocomplete maintains a full copy of the current options, not just the initial options
  • This works on new and existing nodes

@DafyddLlyr DafyddLlyr changed the title wip: Use current values, not just initial values wip(DataAutocomplete): Use current values, not just initial values Jan 28, 2025
Copy link

github-actions bot commented Jan 28, 2025

Removed vultr server and associated DNS entries

@DafyddLlyr DafyddLlyr force-pushed the dp/focus-bug-data-autocomplete branch from aa66be5 to cc21861 Compare January 28, 2025 08:27
@DafyddLlyr DafyddLlyr force-pushed the dp/focus-bug-data-autocomplete branch from cc21861 to 82011ca Compare January 28, 2025 08:27
@DafyddLlyr DafyddLlyr changed the title wip(DataAutocomplete): Use current values, not just initial values fix: Use current values to populate DataAutocomplete options, not just static initial values Jan 28, 2025
@DafyddLlyr DafyddLlyr requested a review from a team January 28, 2025 08:43
@DafyddLlyr DafyddLlyr marked this pull request as ready for review January 28, 2025 08:43
Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

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

Tricky one, thanks for resolving this ! Pizza working as expected !

@DafyddLlyr DafyddLlyr merged commit b1b3b62 into main Jan 28, 2025
13 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/focus-bug-data-autocomplete branch January 28, 2025 08:50
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