Skip to content
Closed
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
4 changes: 2 additions & 2 deletions src/cdk-experimental/radio-group/radio-group.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ describe('CdkRadioGroup', () => {
});
});

it('should set aria-orientation to "vertical"', () => {
it('should set aria-orientation to "horizontal"', () => {
setupDefaultRadioGroup();
expect(radioGroupElement.getAttribute('aria-orientation')).toBe('vertical');
expect(radioGroupElement.getAttribute('aria-orientation')).toBe('horizontal');
});

it('should set aria-disabled to false', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/cdk-experimental/radio-group/radio-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class CdkRadioGroup<V> {
protected items = computed(() => this._cdkRadioButtons().map(radio => radio.pattern));

/** Whether the radio group is vertically or horizontally oriented. */
orientation = input<'vertical' | 'horizontal'>('vertical');
orientation = input<'vertical' | 'horizontal'>('horizontal');

/** Whether disabled items in the group should be skipped when navigating. */
skipDisabled = input(true, {transform: booleanAttribute});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="example-container">
<ul
cdkRadioGroup
orientation="horizontal"
class="example-radio-group example-radio-group-horizontal example-parent"
aria-labelledby="horizontal-radio-label"
orientation="vertical"
class="example-radio-group example-parent"
aria-labelledby="vertical-radio-label"
>
<label class="example-label" id="horizontal-radio-label">Favorite Fruit (Horizontal)</label>
<label class="example-label" id="vertical-radio-label">Favorite Fruit (Vertical)</label>
@for (fruit of fruits; track fruit) {
<li
class="example-radio-button example-stateful example-selectable"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
cursor: pointer;
position: relative;
align-items: center;
flex-shrink: 0;
border-radius: var(--mat-sys-corner-extra-small);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h4>Standard</h4>
</div>

<div class="example-radio-container">
<h4>Horizontal Orientation</h4>
<h4>Vertical Orientation</h4>
<cdk-radio-group-horizontal-example></cdk-radio-group-horizontal-example>
</div>

Expand Down
Loading