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

Clearing selection in single select #7285

Open
marek5816 opened this issue Feb 15, 2024 · 1 comment
Open

Clearing selection in single select #7285

marek5816 opened this issue Feb 15, 2024 · 1 comment
Labels
Feature New functionality not yet included in Sulu

Comments

@marek5816
Copy link

marek5816 commented Feb 15, 2024

Problem description

When using single select, user can not clear his selection, this scenario can be handled only be creating select option, that have dummy value for clear selection purpose

Proposed solution

Add some X icon before drop down icon for clearing purpose, and also when user chose already selected option it will clear (unselect) selection

@marek5816 marek5816 added the Feature New functionality not yet included in Sulu label Feb 15, 2024
@marek5816
Copy link
Author

marek5816 commented Feb 16, 2024

I think this should not be much of problem, from field side, Select.js can be extended with some clearSelection function with this.props.onSelect(undefined) (something similar is also needed for basic select (multi select) field), that would be passed to into DisplayValue.js that will have another icon su-times before <Icon className={displayValueStyles.toggle} name="su-angle-down" />

But not every select field need clearing, for example, when there is listView and on bottom you can choose how many items should be shown (limit), there is not necessary to have this clear feature. So there should be some more configuration available to enable/disable it. Maybe also for xml files there should be some parameter when formView is used

I am not much skilled in react to implement it, maybe someone can take look on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New functionality not yet included in Sulu
Projects
None yet
Development

No branches or pull requests

1 participant