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

Fix #7074: ConfirmDialog - RejectButton classes in unstyled mode are not applied #7075

Merged
Merged
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 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')
);

melloware marked this conversation as resolved.
Show resolved Hide resolved
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
Loading