Skip to content

Commit 633c2ed

Browse files
committed
fix(Item): make changes only when under context of select modal
1 parent e2d565e commit 633c2ed

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

core/src/components/item/item.ionic.scss

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
:host {
88
--background: #{globals.$ion-bg-surface-default};
99
--background-activated: #{globals.$ion-bg-select-default};
10-
--background-focused: #{globals.$ion-bg-neutral-subtlest-press};
11-
--background-focused-opacity: 0;
1210
--border-color: #{globals.$ion-primitives-neutral-300};
1311
--border-style: #{globals.$ion-border-style-solid};
1412
--border-width: #{0 0 globals.$ion-border-size-025 0};
@@ -73,11 +71,6 @@ slot[name="end"]::slotted(*) {
7371

7472
// Item: Focused
7573
// --------------------------------------------------
76-
77-
:host(.ion-focused) .item-native {
78-
--border-radius: #{globals.$ion-border-radius-400};
79-
}
80-
8174
:host(.ion-focused) .item-native::after {
8275
@include globals.border-radius(inherit);
8376
@include globals.position(0, 0, 0, 0);
@@ -118,3 +111,13 @@ slot[name="end"]::slotted(*) {
118111
:host(.item-lines-none) {
119112
--inner-border-width: #{globals.$ion-border-size-0};
120113
}
114+
115+
// Inside a Select Modal
116+
:host(.in-select-modal) {
117+
--background-focused: #{globals.$ion-bg-neutral-subtlest-press};
118+
--background-focused-opacity: 0;
119+
}
120+
121+
:host(.in-select-modal.ion-focused) .item-native {
122+
--border-radius: #{globals.$ion-border-radius-400};
123+
}

core/src/components/item/item.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ export class Item implements ComponentInterface, AnchorInterface, ButtonInterfac
407407
'item-control-needs-pointer-cursor': firstInteractiveNeedsPointerCursor,
408408
'item-disabled': disabled,
409409
'in-list': inList,
410+
'in-select-modal': hostContext('ion-select-modal', this.el),
410411
'item-multiple-inputs': this.multipleInputs,
411412
'ion-activatable': canActivate,
412413
'ion-focusable': this.focusable,

0 commit comments

Comments
 (0)