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

Add the possibility to determinate if an onChange event in FilterableSelect comes from a confirmed choice #6330

Closed
1 task done
franip-sage opened this issue Sep 26, 2023 · 4 comments · Fixed by #6395
Closed
1 task done

Comments

@franip-sage
Copy link

Desired behaviour

The current implementation of FilterableSelect component emits an onChange event in every change detected. So, if a user scrolls through the list of options using the keyboard or if he selects any option pressing the Enter key or clicking the option with the mouse the event is fired.

It should be useful having the possibility to know if the event comes from a confirmed selection or not, so we can know if the user has done the final choice. In that example it would be when the Enter key is pressed of when the option is clicked via mouse.

Current behaviour

The current implementation of FilterableSelect component emits an onChange event in every change of option

Suggested Solution

No response

CodeSandbox or Storybook URL

https://codesandbox.io/s/pensive-chihiro-n56txf?file=/src/App.js

Anything else we should know?

No response

Confidentiality

  • I confirm there is no confidential or commercially sensitive information included.
@franip-sage franip-sage added Enhancement triage Triage Required labels Sep 26, 2023
@robinzigmond
Copy link
Contributor

FE-6233

@robinzigmond robinzigmond added On Backlog and removed triage Triage Required labels Oct 3, 2023
@zaineabidi
Copy link

Hello @robinzigmond - do we have an expected delivery timescale for this work so that we can plan the work on the front end accordingly?

@robinzigmond
Copy link
Contributor

hi @zaineabidi - I can't give you a specific timescale. The ticket is in our "awaiting development" queue but work hasn't been started yet. If you have a specific deadline to deliver this by please speak to @nicktitchmarsh so we can prioritise.

edleeks87 added a commit that referenced this issue Oct 27, 2023
Adds a `CustomSelectChangeEvent` type which defines the shape of the new change event emitted when
the input value changes, backwards compatibility is maintained so it is still possible to continue
to use React's ChangeEvent. Within the new custom event there is a `selectionConfirmed` property
that indicates when a user has pressed `Enter` or clicked on a given `Option`.

fix #6330
edleeks87 added a commit that referenced this issue Oct 27, 2023
Adds a `CustomSelectChangeEvent` type which defines the shape of the new change event emitted when
the input value changes, backwards compatibility is maintained so it is still possible to continue
to use React's ChangeEvent. Within the new custom event there is a `selectionConfirmed` property
that indicates when a user has pressed `Enter` or clicked on a given `Option`.

fix #6330
edleeks87 added a commit that referenced this issue Oct 27, 2023
Adds a `CustomSelectChangeEvent` type which defines the shape of the new change event emitted when
the input value changes, backwards compatibility is maintained so it is still possible to continue
to use React's ChangeEvent. Within the new custom event there is a `selectionConfirmed` property
that indicates when a user has pressed `Enter` or clicked on a given `Option`.

fix #6330
edleeks87 added a commit that referenced this issue Oct 31, 2023
Adds a `CustomSelectChangeEvent` type which defines the shape of the new change event emitted when
the input value changes, backwards compatibility is maintained so it is still possible to continue
to use React's ChangeEvent. Within the new custom event there is a `selectionConfirmed` property
that indicates when a user has pressed `Enter` or clicked on a given `Option`.

fix #6330
edleeks87 added a commit that referenced this issue Nov 3, 2023
Adds a `CustomSelectChangeEvent` type which defines the shape of the new change event emitted when
the input value changes, backwards compatibility is maintained so it is still possible to continue
to use React's ChangeEvent. Within the new custom event there is a `selectionConfirmed` property
that indicates when a user has pressed `Enter` or clicked on a given `Option`.

fix #6330
carbonci pushed a commit that referenced this issue Nov 8, 2023
## [123.7.0](v123.6.0...v123.7.0) (2023-11-08)

### Features

* **select:** add selectionConfirmed property to event emitted on change ([748a17b](748a17b)), closes [#6330](#6330)

### Bug Fixes

* **filterable-select, multi-select:** handle when filter text has no match and enter pressed ([84ebef7](84ebef7))
* **option:** ensure fill prop is not passed to underlying DOM element ([2a8cfc1](2a8cfc1))
@carbonci
Copy link
Collaborator

carbonci commented Nov 8, 2023

🎉 This issue has been resolved in version 123.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants