Skip to content

Cannot redefine property: disabled (disableable.js) #1148

Open
@eneadrian

Description

Flux version

2.0.1

Livewire version

3.5

Tailwind version

4.0.7

Browser and Operating System

Chrome on Windows

What is the problem?

When you sort a select input with variant attribute it gives the following error: Uncaught TypeError: Cannot redefine property: disabled

<flux:select variant="listbox" searchable>

Image

Code snippets

Fix:

// js/mixins/disableable.js

+ if (!Object.getOwnPropertyDescriptor(this.el, 'disabled')) {
Object.defineProperty(this.el, "disabled", {
    get: () => {
        return this.el.hasAttribute("disabled");
    },
    set: (value2) => {
        if (value2) {
            this.el.setAttribute("disabled", "");
        } else {
            this.el.removeAttribute("disabled");
        }
    }
});
+ }

How do you expect it to work?

Please confirm (incomplete submissions will not be addressed)

  • I have provided easy and step-by-step instructions to reproduce the bug.
  • I have provided code samples as text and NOT images.
  • I understand my bug report will be closed if I haven't met the criteria above.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions