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(ui5-view-settings-dialog): clicking on the radio button/checkbox works #10706

Merged
merged 16 commits into from
Jan 31, 2025

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Jan 29, 2025

View Settings Dialog - selection issues

Fixes

  • clicking on the radio button (the problem reported in the original issue) in the "sort" view
  • clicking on the checkbox in the "filters" view

Background

Currently, ui5-view-settings-dialog binds to the item-click event of ui5-list for all scenarios. However, this event is only fired if the user clicks on the item itself (its text). Therefore, if the user clicks on the radio button or checkbox instead, nothing happens (the item-click event is not fired).

Solution

The fix is to bind to the selection-change event of ui5-list instead, which is fired both when the user clicks on the text, and on the radio button/checkbox alike. For the step 1 of filters (pure list with no radio buttons/checkboxes the existing itemClick event should be used, so no change there).

Additionally, the _setSelectedProp function has been refactored - passing it the event object is an overkill, because it must extract the text from the selected item again. It's better to just pass the text (already extracted) directly.

Note: some of the code in the test should be extracted to commands for the dialog/list components. This can be done independently after a discussion with the owners of these components.

closes: #10515

Copy link
Contributor

@hinzzx hinzzx left a comment

Choose a reason for hiding this comment

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

Clicking on a FilterItem, doesn't switch the view to select FilterItemOption's.

Before

2025-01-30_10-32-01

After

2025-01-30_10-32-08

@vladitasev vladitasev changed the title fix(ui5-view-settings-dialog): clicking on the radio button works fix(ui5-view-settings-dialog): clicking on the radio button/checkbox works Jan 30, 2025
@vladitasev
Copy link
Contributor Author

Clicking on a FilterItem, doesn't switch the view to select FilterItemOption's.

Fixed.


// Open the dialog and wait until it's visible
cy.get("@vsd")
.invoke("prop", "open", true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Separate invoke from other commands.

	cy.get("@vsd")
		.invoke("prop", "open", true)

	cy.get("@vsd")
		.shadow()
		.find("[ui5-dialog]")
		.should("be.visible");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@hinzzx hinzzx left a comment

Choose a reason for hiding this comment

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

Looks good to me!
Fixes the reported bug, the event detail seems as expected and the behavior is correct

@vladitasev vladitasev merged commit ff1bdeb into main Jan 31, 2025
10 checks passed
@vladitasev vladitasev deleted the vsd-radio-fix branch January 31, 2025 09:39
@ui5-webcomponents-bot
Copy link
Collaborator

🎉 This PR is included in version v2.7.0 🎉

The release is available on v2.7.0

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

[SF][ViewSettingsDialog]: Sorting by selecting radio buttons is not working in ViewSettingsDialog
5 participants