Skip to content

Commit

Permalink
fix(ui-library): fixed contrast violation in disabled state (#802)
Browse files Browse the repository at this point in the history
* fix(ui-library): fixed contrast violation in disabled state for icon-button and text-button and fixed that the text can not be selected in disabled mode for different browsers
---------

Co-authored-by: christian.b.hoffmann <[email protected]>
Co-authored-by: Christian Hoffmann <[email protected]>
  • Loading branch information
3 people authored Jan 19, 2024
1 parent 6d6e97a commit 3a4caca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export class BlrIconButton extends LitElement {
<span
aria-label=${this.arialabel || nothing}
class="blr-semantic-action blr-icon-button ${classes}"
aria-disabled=${this.disabled ? 'true' : nothing}
@click=${this.handleClick}
id=${this.buttonId || nothing}
tabindex=${this.disabled ? nothing : '0'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,12 @@ export class BlrTextButton extends LitElement {
</style>
<span
class="${classes}"
aria-disabled=${this.disabled ? 'true' : nothing}
@click="${this.handleClick}"
tabindex=${this.disabled ? nothing : '0'}
@focus=${this.handleFocus}
@blur=${this.handleBlur}
role=${this.disabled ? nothing : 'button'}
role="button"
@keydown=${(event: KeyboardEvent) => {
if (event.code === 'Space') {
this.handleClick(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export const { tokenizedLight: actionLight, tokenizedDark: actionDark } = render
&.disabled {
pointer-events: none;
cursor: not-allowed;
user-select: none;
-webkit-user-select: none;
}
&.xs {
Expand Down

0 comments on commit 3a4caca

Please sign in to comment.