Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
eneadrian opened this issue Feb 21, 2025 · 1 comment
Open
3 tasks done

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

eneadrian opened this issue Feb 21, 2025 · 1 comment
Assignees

Comments

@eneadrian
Copy link

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.
@joshhanley
Copy link
Member

@eneadrian thanks for reporting! This is a similar issue to #806. We're going to leave this open for now until we can add a fix that handles both cases.

@joshhanley joshhanley self-assigned this Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants