Skip to content

Commit

Permalink
fix(core): enable pointer events on disabled button (#10378)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Feb 17, 2025
1 parent 7c0076f commit bf14135
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion projects/core/styles/components/appearance.less
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
});

.appearance-disabled({
pointer-events: none;
cursor: initial;
opacity: var(--tui-disabled-opacity);
});
}
4 changes: 2 additions & 2 deletions projects/core/styles/mixins/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

.interactive(@ruleset) {
// TODO remove after dropping Safari 13 support
&:matches(a, button, select, textarea, input, label) {
&:matches(a, button, select, textarea, input, label):not(:disabled) {
@ruleset();
}

&:is(a, button, select, textarea, input, label) {
&:is(a, button, select, textarea, input, label):not(:disabled) {
@ruleset();
}
}
Expand Down
4 changes: 2 additions & 2 deletions projects/core/styles/mixins/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

@mixin interactive {
// TODO remove after dropping Safari 13 support
&:matches(a, button, select, textarea, input) {
&:matches(a, button, select, textarea, input):not(:disabled) {
@content;
}

&:is(a, button, select, textarea, input) {
&:is(a, button, select, textarea, input):not(:disabled) {
@content;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ test.describe('InputCardGroup', () => {

const {numberTextfield} = new TuiInputCardGroupPO(apiPageExample);

await expect(numberTextfield).toHaveCSS('pointer-events', 'none');
await expect(numberTextfield).toHaveAttribute('disabled');
await expect(numberTextfield).toHaveScreenshot(
'04-input-card-group-disabled.png',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@
Floating
</button>

<button
appearance="primary"
disabled
tuiButton
type="button"
>
Primary disabled
</button>

<div>
See
<a
Expand Down

0 comments on commit bf14135

Please sign in to comment.