Skip to content

Commit 9ba0dc4

Browse files
committed
remove unnecessary _accInfo property and improve keydown handler
1 parent 9f7c7a2 commit 9ba0dc4

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

packages/fiori/src/ProductSwitch.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ class ProductSwitch extends UI5Element {
128128

129129
onBeforeRendering() {
130130
this.desktopColumns = this.items.length > 6 ? 4 : 3;
131-
132-
this.items.forEach(item => {
133-
item._accInfo = {
134-
role: "listitem",
135-
};
136-
});
137131
}
138132

139133
_handleResize() {
@@ -163,9 +157,7 @@ class ProductSwitch extends UI5Element {
163157
_onkeydown(event) {
164158
if (isDown(event)) {
165159
this._handleDown(event);
166-
}
167-
168-
if (isUp(event)) {
160+
} else if (isUp(event)) {
169161
this._handleUp(event);
170162
}
171163
}

packages/fiori/src/ProductSwitchItem.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</a>
1414
{{else}}
1515
<div
16-
role="{{_accInfo.role}}"
16+
role="listitem"
1717
class="ui5-product-switch-item-root"
1818
data-sap-focus-ref
1919
@focusout="{{_onfocusout}}"

packages/fiori/src/ProductSwitchItem.js

-4
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ const metadata = {
102102
defaultValue: "-1",
103103
noAttribute: true,
104104
},
105-
106-
_accInfo: {
107-
type: Object,
108-
},
109105
},
110106
slots: /** @lends sap.ui.webcomponents.fiori.ProductSwitchItem.prototype */ {
111107
},

0 commit comments

Comments
 (0)