Skip to content

Commit

Permalink
Fix #7074: ConfirmDialog - RejectButton classes in unstyled mode are …
Browse files Browse the repository at this point in the history
…not applied (#7075)

* fix: ConfirmDialog typescript definitions

* fix: Reject button merge props with pt
  • Loading branch information
ivanpajon committed Aug 23, 2024
1 parent 2e898be commit ee33efa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions components/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -14946,14 +14946,14 @@
"name": "rejectButton",
"optional": true,
"readonly": false,
"type": "ButtonPassThroughOptions",
"type": "ConfirmDialogPassThroughType<HTMLAttributes<HTMLButtonElement>>",
"description": "Uses to pass attributes to the Button component."
},
{
"name": "acceptButton",
"optional": true,
"readonly": false,
"type": "ButtonPassThroughOptions",
"type": "ConfirmDialogPassThroughType<HTMLAttributes<HTMLButtonElement>>",
"description": "Uses to pass attributes to the Button component."
},
{
Expand Down
27 changes: 15 additions & 12 deletions components/lib/confirmdialog/ConfirmDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,21 @@ export const ConfirmDialog = React.memo(
getPropValue('rejectClassName')
);

const rejectButtonProps = {
label: rejectLabel,
autoFocus: defaultFocus === 'reject',
icon: getPropValue('rejectIcon'),
className: classNames(getPropValue('rejectClassName'), cx('rejectButton', { getPropValue })),
onClick: reject,
pt: ptm('rejectButton'),
unstyled: props.unstyled,
__parentMetadata: {
parent: metaData
}
};
const rejectButtonProps = mergeProps(
{
label: rejectLabel,
autoFocus: defaultFocus === 'reject',
icon: getPropValue('rejectIcon'),
className: classNames(getPropValue('rejectClassName'), cx('rejectButton', { getPropValue })),
onClick: reject,
pt: ptm('rejectButton'),
unstyled: props.unstyled,
__parentMetadata: {
parent: metaData
}
},
ptm('rejectButton')
);

const acceptButtonProps = mergeProps(
{
Expand Down
7 changes: 2 additions & 5 deletions components/lib/confirmdialog/confirmdialog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
import * as React from 'react';
import { CSSTransitionProps as ReactCSSTransitionProps } from 'react-transition-group/CSSTransition';
import { ButtonPassThroughOptions } from '../button/button';
import { ComponentHooks } from '../componentbase/componentbase';
import { DialogProps } from '../dialog';
import { PassThroughOptions } from '../passthrough';
Expand Down Expand Up @@ -73,14 +72,12 @@ export interface ConfirmDialogPassThroughOptions {
footer?: ConfirmDialogPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the Button component.
* @see {@link ButtonPassThroughOptions}
*/
rejectButton?: ButtonPassThroughOptions;
rejectButton?: ConfirmDialogPassThroughType<React.HTMLAttributes<HTMLButtonElement>>;
/**
* Uses to pass attributes to the Button component.
* @see {@link ButtonPassThroughOptions}
*/
acceptButton?: ButtonPassThroughOptions;
acceptButton?: ConfirmDialogPassThroughType<React.HTMLAttributes<HTMLButtonElement>>;
/**
* Used to manage all lifecycle hooks
* @see {@link ComponentHooks}
Expand Down

0 comments on commit ee33efa

Please sign in to comment.