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(wip): Don't allow DataAutocomplete to select the first value #4217

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Jan 28, 2025

Still a work in progress - getting inconsistent results locally and on pizza

What's the problem?

Currently, we're using the autoHighlight prop (docs) which is automatically selecting the first value on focus. I don't believe that this is the intended behaviour, as highlighted by @augustlindemer here - https://opensystemslab.slack.com/archives/C5Q59R3HB/p1737660734834029?thread_ts=1737640916.451959&cid=C5Q59R3HB (OSL Slack).

What's the solution?

Removing this prop (setting to the default false) removes this behaviour. I can now enter a value, tab away / lost focus, and my new value is retained.

To test...

TODO!

@DafyddLlyr DafyddLlyr changed the title fix: Don't allow 'DataAutocomplete` to select the first value fix: Don't allow DataAutocomplete to select the first value Jan 28, 2025
Copy link

github-actions bot commented Jan 28, 2025

Pizza

Deployed e934fd8 to https://4217.planx.pizza.

Useful links:

@DafyddLlyr DafyddLlyr changed the title fix: Don't allow DataAutocomplete to select the first value fix(wip): Don't allow DataAutocomplete to select the first value Jan 28, 2025
@DafyddLlyr DafyddLlyr force-pushed the dp/dataautocomple-selecting-first-value branch from 7992480 to 288a637 Compare January 28, 2025 08:51
@augustlindemer
Copy link
Collaborator

Commenting on this mid process, you may already know about these:

When shortening an existing value of a field, on lost focus it reselects existing value of that field, even if new shortened value matches any other existing values.

Select hover does not clear when the cursor moves outside of the dropdown, and the last hovered item of the dropdown is selected as input on lost focus.

@DafyddLlyr DafyddLlyr force-pushed the dp/dataautocomple-selecting-first-value branch from 288a637 to 29551c4 Compare February 3, 2025 09:28
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