FIX #1983 : Updated Css to move disabled button smoothly (#4744)

- 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:
Yash Vibhandik 2021-07-07 10:44:18 +05:30 committed by GitHub
parent f414285201
commit 43bf1ef72b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -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)

View File

@ -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 = {