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

feat(ui5-product-switch): Selected state added to an item #3872

Merged
merged 14 commits into from
Sep 24, 2021

Conversation

PetyaMarkovaBogdanova
Copy link
Contributor

Now ui5-product-switch-item recieves a selected state on click or keydown, which is unique for an ui5-product-switch collection

@@ -156,6 +156,13 @@ class ProductSwitch extends UI5Element {
}
}

handleProductSwitchItemClick(event) {
event.target.parentNode.querySelectorAll("ui5-product-switch-item").forEach(item => {
Copy link
Member

Choose a reason for hiding this comment

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

To get the ProductSwitch items, you just need to use "this.items" and this will become
this.items.forEach(item => { item.selected = false;});

Copy link
Member

Choose a reason for hiding this comment

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

Should not this behaviour also happen on SPACE/ENTER?

@ilhan007 ilhan007 requested a review from nnaydenow September 15, 2021 13:21
@@ -26,6 +26,7 @@
#individual-pop .avatar-slot,
#groupPop .avatar-slot {
display: inline-block;
vertical-align: middle;
Copy link
Contributor

Choose a reason for hiding this comment

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

seems to be not related to this change

@nnaydenow
Copy link
Contributor

Shift + Space should not change the selection. Selected item should have --sapList_Hover_SelectionBackground background color when it is hovered.

ilhan007
ilhan007 previously approved these changes Sep 20, 2021
@ilhan007 ilhan007 merged commit 9e7928b into master Sep 24, 2021
@ilhan007 ilhan007 deleted the add-selected-state-ProductSwitchItem branch September 24, 2021 13:30
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.

3 participants