Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(toast): remove cssClass from ToastButton #28977

Merged
merged 6 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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: 4 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,7 @@ This allows components to inherit the color properly when used outside of Ionic
- `ion-picker` and `ion-picker-column` have been renamed to `ion-picker-legacy` and `ion-picker-legacy-column`, respectively. This change was made to accommodate the new inline picker component while allowing developers to continue to use the legacy picker during this migration period.
- Only the component names have been changed. Usages such as `ion-picker` or `IonPicker` should be changed to `ion-picker-legacy` and `IonPickerLegacy`, respectively.
- Non-component usages such as `pickerController` or `useIonPicker` remain unchanged. The new picker displays inline with your page content and does not have equivalents for these non-component usages.

<h4 id="version-8x-toast">Toast</h4>

- `cssClass` has been removed from the `ToastButton` interface. This was previously used to apply a custom class to the toast buttons. Developers can use the "button" shadow part to style the buttons.
brandyscarney marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 0 additions & 7 deletions core/src/components/toast/toast-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { IonicSafeString } from '../../utils/sanitization';
export interface ToastOptions {
header?: string;
message?: string | IonicSafeString;
cssClass?: string | string[];
thetaPC marked this conversation as resolved.
Show resolved Hide resolved
duration?: number;
buttons?: (ToastButton | string)[];
position?: 'top' | 'bottom' | 'middle';
Expand All @@ -27,18 +26,12 @@ export interface ToastOptions {

export type ToastLayout = 'baseline' | 'stacked';

// TODO FW-4923 remove cssClass property

export interface ToastButton {
text?: string;
icon?: string;
side?: 'start' | 'end';
role?: 'cancel' | string;

/**
* @deprecated Use the toast button's CSS Shadow Parts instead.
*/
cssClass?: string | string[];
htmlAttributes?: { [key: string]: any };
handler?: () => boolean | void | Promise<boolean | void>;
}
Expand Down
1 change: 0 additions & 1 deletion core/src/components/toast/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ const buttonClass = (button: ToastButton): CssClassMap => {
[`toast-button-${button.role}`]: button.role !== undefined,
'ion-focusable': true,
'ion-activatable': true,
...getClassMap(button.cssClass),
};
};

Expand Down
Loading