Skip to content

fix(VariantManagement): fix type extraction for button click handler #5095

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

Merged
merged 1 commit into from
Sep 27, 2023
Merged
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
6 changes: 3 additions & 3 deletions packages/main/src/components/VariantManagement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ export interface VariantManagementPropTypes extends Omit<CommonProps, 'onSelect'
*
* __Note:__ Calling `event.preventDefault()` prevents the dialog from closing when clicked.
*/
onSaveAs?: (e: Parameters<ButtonPropTypes['onClick']>[0] & { detail: SelectedVariant }) => void;
onSaveAs?: (e: Parameters<NonNullable<ButtonPropTypes['onClick']>>[0] & { detail: SelectedVariant }) => void;
/**
* The event is fired when the "Save" button is clicked inside the Manage Views dialog.
*
* __Note:__ Calling `event.preventDefault()` prevents the dialog from closing when clicked.
*/
onSaveManageViews?: (
e: Parameters<ButtonPropTypes['onClick']>[0] & {
e: Parameters<NonNullable<ButtonPropTypes['onClick']>>[0] & {
detail: {
deletedVariants: VariantItemPropTypes[];
prevVariants: VariantItemPropTypes[];
Expand All @@ -179,7 +179,7 @@ export interface VariantManagementPropTypes extends Omit<CommonProps, 'onSelect'
*
* __Note:__ The save button is only displayed if the `VariantManagement` is in `dirtyState` and the selected variant is not in `readOnly` mode.
*/
onSave?: (e: Parameters<ButtonPropTypes['onClick']>[0] & { detail: SelectedVariant }) => void;
onSave?: (e: Parameters<NonNullable<ButtonPropTypes['onClick']>>[0] & { detail: SelectedVariant }) => void;
}

const styles = {
Expand Down