Skip to content
Open
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 packages/primeng/src/togglebutton/style/togglebuttonstyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const classes = {
'p-togglebutton-checked': instance.checked,
'p-invalid': instance.invalid(),
'p-disabled': instance.$disabled(),
'p-togglebutton-sm p-inputfield-sm': instance.size === 'small',
'p-togglebutton-lg p-inputfield-lg': instance.size === 'large',
'p-togglebutton-sm p-inputfield-sm': instance.size() === 'small',
'p-togglebutton-lg p-inputfield-lg': instance.size() === 'large',
'p-togglebutton-fluid': instance.fluid()
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/primeng/src/togglebutton/togglebutton.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ describe('ToggleButton', () => {
await fixture.whenStable();
fixture.detectChanges();

expect(toggleButtonInstance.size).toBe('large');
expect(toggleButtonInstance.size()).toBe('large');
});
});

Expand Down
5 changes: 3 additions & 2 deletions packages/primeng/src/togglebutton/togglebutton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ export class ToggleButton extends BaseEditableHolder<ToggleButtonPassThrough> {
@Input({ transform: booleanAttribute }) autofocus: boolean | undefined;
/**
* Defines the size of the component.
* @defaultValue undefined
* @group Props
*/
@Input() size: 'large' | 'small';
size = input<'small' | 'large' | undefined>();
/**
* Whether selection can not be cleared.
* @group Props
Expand Down Expand Up @@ -270,7 +271,7 @@ export class ToggleButton extends BaseEditableHolder<ToggleButtonPassThrough> {
return this.cn({
checked: this.active,
invalid: this.invalid(),
[this.size as string]: this.size
[this.size() as string]: this.size()
});
}
}
Expand Down
Loading