- conditionally updated css to move disabled button smoothly - omit disabled property of button and mange disable by className - update cypress CheckBox_spec test
This commit is contained in:
parent
f414285201
commit
43bf1ef72b
|
|
@ -81,7 +81,7 @@ describe("Checkbox Widget Functionality", function() {
|
|||
cy.get(publish.checkboxWidget).click();
|
||||
cy.get(widgetsPage.formButtonWidget)
|
||||
.contains("Submit")
|
||||
.should("have.attr", "disabled");
|
||||
.should("have.class", "bp3-disabled");
|
||||
|
||||
cy.get(publish.checkboxWidget).click();
|
||||
cy.get(widgetsPage.formButtonWidget)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ const AccentColorMap: Record<ButtonStyleName, string> = {
|
|||
};
|
||||
|
||||
const ButtonWrapper = styled((props: ButtonStyleProps & IButtonProps) => (
|
||||
<Button {..._.omit(props, ["accent", "filled"])} />
|
||||
<Button {..._.omit(props, ["accent", "filled", "disabled"])} />
|
||||
))<ButtonStyleProps>`
|
||||
&&&& {
|
||||
${ButtonColorStyles};
|
||||
|
|
@ -122,7 +122,10 @@ type ButtonStyleProps = {
|
|||
|
||||
// To be used in any other part of the app
|
||||
export function BaseButton(props: IButtonProps & ButtonStyleProps) {
|
||||
return <ButtonWrapper {...props} />;
|
||||
const className = props.disabled
|
||||
? `${props.className} bp3-disabled`
|
||||
: props.className;
|
||||
return <ButtonWrapper {...props} className={className} />;
|
||||
}
|
||||
|
||||
BaseButton.defaultProps = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user