Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,7 @@ ion-radio,css-prop,--color
ion-radio,css-prop,--color-checked
ion-radio,css-prop,--inner-border-radius
ion-radio,part,container
ion-radio,part,label
ion-radio,part,mark

ion-radio-group,none
Expand Down
7 changes: 0 additions & 7 deletions core/src/components/radio/radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,6 @@ input {
// ----------------------------------------------------------------

.label-text-wrapper {
/**
* This ensures that double tapping this text
* clicks the <label> and focuses the radio
* when a screen reader is enabled.
*/
pointer-events: none;

text-overflow: ellipsis;

white-space: nowrap;
Expand Down
2 changes: 2 additions & 0 deletions core/src/components/radio/radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type { Color, StyleEventDetail } from '../../interface';
* @slot - The label text to associate with the radio. Use the "labelPlacement" property to control where the label is placed relative to the radio.
*
* @part container - The container for the radio mark.
* @part label - The label text describing the radio.
* @part mark - The checkmark or dot used to indicate the checked state.
*/
@Component({
Expand Down Expand Up @@ -297,6 +298,7 @@ export class Radio implements ComponentInterface {
'label-text-wrapper': true,
'label-text-wrapper-hidden': !hasLabel,
}}
part="label"
>
<slot></slot>
</div>
Expand Down
17 changes: 17 additions & 0 deletions core/src/components/radio/test/radio.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ describe('ion-radio', () => {

expect(radio.classList.contains('radio-checked')).toBe(true);
});

it('should render the radio with shadow parts', async () => {
const page = await newSpecPage({
components: [Radio, RadioGroup],
html: `
<ion-radio-group>
<ion-radio value="value"></ion-radio>
</ion-radio-group>
`,
});

const radio = page.body.querySelector('ion-radio')!;

expect(radio).toHaveShadowPart('container');
expect(radio).toHaveShadowPart('label');
expect(radio).toHaveShadowPart('mark');
});
});

describe('ion-radio: disabled', () => {
Expand Down