Skip to content

Commit

Permalink
Remove checked property from SegmentItem (#2190)
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusKjeldgaard authored Apr 27, 2022
1 parent dcd1d56 commit 5579c0d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ type SegmentItemBadge = {
export interface SegmentItem {
id: string;
text: string;
/**
* @deprecated Will be removed in next major version. Use `selectedIndex` or `value` on `<kirby-segmented-control>` instead.
*/
checked?: boolean;
badge?: Omit<SegmentItemBadge, 'isCustomIcon'>; // we do not expose the isCustomIcon for the external type
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ export class SegmentedControlComponent {
item.badge.icon !== undefined &&
this.iconRegistryService.getIcon(item.badge.icon) !== undefined;
});

const checkedItemIndex = this.items.findIndex((item) => item.checked);
if (checkedItemIndex > -1) {
console.warn(
'SegmentItem.checked is deprecated - please remove from your `items` configuration. Use `selectedIndex` or `value` on `<kirby-segmented-control>` instead '
);
this._selectedIndex = checkedItemIndex;
}
this._value = this.items[this.selectedIndex];
}

Expand Down

0 comments on commit 5579c0d

Please sign in to comment.