-
Notifications
You must be signed in to change notification settings - Fork 273
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
Conversation
….com/SAP/ui5-webcomponents into add-selected-state-ProductSwitchItem
…o add-selected-state-ProductSwitchItem
packages/fiori/src/ProductSwitch.js
Outdated
@@ -156,6 +156,13 @@ class ProductSwitch extends UI5Element { | |||
} | |||
} | |||
|
|||
handleProductSwitchItemClick(event) { | |||
event.target.parentNode.querySelectorAll("ui5-product-switch-item").forEach(item => { |
There was a problem hiding this comment.
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;});
There was a problem hiding this comment.
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?
@@ -26,6 +26,7 @@ | |||
#individual-pop .avatar-slot, | |||
#groupPop .avatar-slot { | |||
display: inline-block; | |||
vertical-align: middle; |
There was a problem hiding this comment.
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
Shift + Space should not change the selection. Selected item should have --sapList_Hover_SelectionBackground background color when it is hovered. |
Now ui5-product-switch-item recieves a selected state on click or keydown, which is unique for an ui5-product-switch collection