Skip to content

Commit

Permalink
feat(cc-button): throw error if both waiting & disabled are true
Browse files Browse the repository at this point in the history
These properties are mutually exclusive and should not be set to `true`
at the same time to avoid a11y issues.

Fixes #1124
  • Loading branch information
florian-sanders-cc committed Jan 14, 2025
1 parent 0dfe8f4 commit 3a8f191
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/cc-button/cc-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ export class CcButton extends LitElement {
this._cancelClick();
}
}

if (this.waiting && this.disabled) {
throw new Error(
'`waiting` and `disabled` cannot be set to true at the same time, see https://github.com/CleverCloud/clever-components/issues/1124 for more info',
);
}
}

render() {
Expand Down

0 comments on commit 3a8f191

Please sign in to comment.