Skip to content

Commit

Permalink
fix(fab)!: remove disabled state
Browse files Browse the repository at this point in the history
Fixes #4045

PiperOrigin-RevId: 517165006
  • Loading branch information
asyncLiz authored and copybara-github committed Mar 16, 2023
1 parent 9582e00 commit c368e7d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
5 changes: 0 additions & 5 deletions fab/lib/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
vertical-align: top;
}

:host([disabled]) {
cursor: default;
pointer-events: none;
}

.md3-fab {
display: inline-flex;
border: none;
Expand Down
6 changes: 1 addition & 5 deletions fab/lib/fab-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ export abstract class FabShared extends LitElement {
static override shadowRootOptions:
ShadowRootInit = {mode: 'open', delegatesFocus: true};

@property({type: Boolean}) disabled = false;

@property() icon = '';

@property() label = '';
Expand All @@ -52,7 +50,6 @@ export abstract class FabShared extends LitElement {
return html`
<button
class="md3-fab md3-surface ${classMap(this.getRenderClasses())}"
?disabled="${this.disabled}"
aria-label="${ariaLabel}"
@focus="${this.handleFocus}"
@blur="${this.handleBlur}"
Expand Down Expand Up @@ -113,7 +110,6 @@ export abstract class FabShared extends LitElement {
}

private readonly renderRipple = () => {
return html`<md-ripple class="md3-fab__ripple" ?disabled="${
this.disabled}"></md-ripple>`;
return html`<md-ripple class="md3-fab__ripple"></md-ripple>`;
};
}
15 changes: 0 additions & 15 deletions fab/md-fab_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ describe('md-fab-extended', () => {
const {harness} = await setupTest();
expect(harness.element).toBeInstanceOf(MdFabExtended);
expect(harness.element.lowered).toEqual(false);
expect(harness.element.disabled).toEqual(false);
expect(harness.element.label).toEqual('');
expect(harness.element.icon).toEqual('');
});
Expand All @@ -62,20 +61,6 @@ describe('md-fab-extended', () => {
});
});

describe('disabled', () => {
it('get/set updates the disabled property on the native button element',
async () => {
const {harness, button} = await setupTest();
harness.element.disabled = true;
await env.waitForStability();

expect(button.disabled).toEqual(true);
harness.element.disabled = false;
await env.waitForStability();
expect(button.disabled).toEqual(false);
});
});

describe('icon', () => {
it('will generate an md-icon', async () => {
const {harness, button} = await setupTest();
Expand Down

0 comments on commit c368e7d

Please sign in to comment.