Skip to content

Commit f30d039

Browse files
committed
MOBILE-4653 ionic: Select the correct element on ion-select
Reported here: ionic-team/ionic-framework#30481
1 parent 633dbc8 commit f30d039

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

patches/@ionic+core+8.5.0.patch

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
diff --git a/node_modules/@ionic/core/components/ion-select.js b/node_modules/@ionic/core/components/ion-select.js
2+
index fe875d9..ff23640 100644
3+
--- a/node_modules/@ionic/core/components/ion-select.js
4+
+++ b/node_modules/@ionic/core/components/ion-select.js
5+
@@ -186,7 +186,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
6+
const scrollSelectedIntoView = () => {
7+
const indexOfSelected = this.childOpts.findIndex((o) => o.value === this.value);
8+
if (indexOfSelected > -1) {
9+
- const selectedItem = overlay.querySelector(`.select-interface-option:nth-child(${indexOfSelected + 1})`);
10+
+ const selectedItem = overlay.querySelector(`.select-interface-option:nth-of-type(${indexOfSelected + 1})`);
11+
if (selectedItem) {
12+
/**
13+
* Browsers such as Firefox do not
114
diff --git a/node_modules/@ionic/core/components/popover.js b/node_modules/@ionic/core/components/popover.js
215
index df0b0f6..ffd1bac 100644
316
--- a/node_modules/@ionic/core/components/popover.js
@@ -170,7 +183,7 @@ index d32e60c..491c281 100644
170183
const contentEl = root.querySelector('.popover-content');
171184
const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target);
172185
diff --git a/node_modules/@ionic/core/hydrate/index.js b/node_modules/@ionic/core/hydrate/index.js
173-
index 6de5db2..e9c8ecc 100644
186+
index 6de5db2..bc73a84 100644
174187
--- a/node_modules/@ionic/core/hydrate/index.js
175188
+++ b/node_modules/@ionic/core/hydrate/index.js
176189
@@ -24183,8 +24183,10 @@ const iosEnterAnimation$1 = (baseEl, opts) => {

0 commit comments

Comments
 (0)