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

Show Clear button on Combobox without having it as a search #11921

Closed
abhijith-darshan opened this issue May 16, 2024 · 1 comment · Fixed by #11924
Closed

Show Clear button on Combobox without having it as a search #11921

abhijith-darshan opened this issue May 16, 2024 · 1 comment · Fixed by #11924
Assignees
Labels
enhancement New feature or request

Comments

@abhijith-darshan
Copy link
Member

Is this a bug, enhancement, or feature request?

Enhancement

Describe your proposal.

In Combobox the clear button is only shown if both isSearch and showClearButton are set to true

In UI5 it is possible to show clear button on a non isSearch mode as well as shown below

https://sapui5.hana.ondemand.com/#/entity/sap.m.ComboBox/sample/sap.m.sample.ComboBoxClearIcon

image

Can you handle that on the application side

No due to && condition in combobox.component.html

@if (isSearch && showClearButton && inputText && inputText.length > 0) {

Which versions of Angular and Fundamental Library for Angular are affected? Please, specify the exact version. (If this is a feature request, use current version.)

Current version

If this is a bug, please provide steps for reproducing it; the exact components you are using;

N/A

Please provide relevant source code (if applicable).

N/A

Please provide stackblitz example(s).

N/A

In case this is Accessibility related topic, did you consult with an accessibility expert? If not, please do so and share their recommendations.

N/A

Did you check the documentation and the API?

Yes

Did you search for similar issues?

Yes

Is there anything else we should know?

No

IMPORTANT: Please refrain from providing links or screenshots of SAP's internal information, as this project is open-source, and its contents are accessible to anyone.

@abhijith-darshan
Copy link
Member Author

abhijith-darshan commented May 16, 2024

I think setting it as an OR || condition would solve this -

....
@if ((isSearch || showClearButton) && inputText && inputText.length > 0)
....

Consequence would be that when Combobox is used in non search mode OR in search mode, by default the clear button is shown. But can be overridden with showClearButton flag with false

@droshev droshev self-assigned this May 18, 2024
@droshev droshev added the enhancement New feature or request label May 18, 2024
@droshev droshev added this to the Sprint 134 - May 2024 milestone May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants