Skip to content

Commit 3f8346e

Browse files
authored
fix(select-modal): match radio styles to iOS native (#30119)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> When the `select-modal` displays radios, a bottom border is shown under the radio icon and text. However, native iOS does not have the border under the icon. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - The bottom border is displayed under the radio text only. - The `ion-item` within `select-modal` has been given the prop of `lines="none"` since border styling has been done through `select-md.ios.scss` and because `md` doesn't use it. - Updated snapshots ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> [Preview (iOS)](https://ionic-framework-git-rou-11404-ionic1.vercel.app/src/components/select/test/basic?ionic%3Amode=ios) [Preview (md)](https://ionic-framework-git-rou-11404-ionic1.vercel.app/src/components/select/test/basic)
1 parent 05928e3 commit 3f8346e

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
11
@import "./select-modal";
2+
@import "../item/item.ios.vars";
3+
@import "../radio/radio.ios.vars";
4+
5+
ion-item {
6+
--inner-padding-end: 0;
7+
}
8+
9+
/**
10+
* The bottom border of the item should only be displayed
11+
* under the text and not the radio icon.
12+
*/
13+
ion-radio::after {
14+
@include position(null, null, 0, calc($radio-ios-icon-width + $item-ios-padding-start));
15+
position: absolute;
16+
17+
width: calc(100% - $radio-ios-icon-width - $item-ios-padding-start); /* Adjust width based on the shift */
18+
19+
border-width: #{0px 0px $item-ios-border-bottom-width 0px};
20+
border-style: #{$item-ios-border-bottom-style};
21+
border-color: #{$item-ios-border-bottom-color};
22+
23+
content: "";
24+
}

core/src/components/select-modal/select-modal.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export class SelectModal implements ComponentInterface {
8181
<ion-radio-group value={checked} onIonChange={(ev) => this.callOptionHandler(ev)}>
8282
{this.options.map((option) => (
8383
<ion-item
84+
lines="none"
8485
class={{
8586
// TODO FW-4784
8687
'item-radio-checked': option.value === checked,

0 commit comments

Comments
 (0)