-
Notifications
You must be signed in to change notification settings - Fork 42
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
[1.0.23] flux.js error: Uncaught TypeError: Cannot redefine property: disabled #708
Comments
@lotje-kinable I believe the issue is the e.g. change your
When using |
Hello! You are trying to define modals inside a loop. And you are also trying to dynamically change the variable ;; on which the output of modal windows depends, which leads to the same error... Conclusion, modals must be defined separately. Somewhere in a parallel universe, the correct code would be like this:
|
@jeffchown actually the flux:modal works fine, but it is the flux:select with the @foreach inside the fllux:modal that seems to throw the error. -> I tried the @teleport('body') and now I get a few "to.setAttribute is not a function" errors. module.cjs.js:354 Uncaught TypeError: to.setAttribute is not a function |
@lotje-kinable I tested your Volt component after wrapping the Did you If so, then maybe you'll need to give @tm-blg 's suggestion a try. |
@jeffchown It works! I did not run 'php artisan view:clear' (but npm run dev was running). Could you tell my why 'php artisan view:clear' is necessary? Thanks again! |
@lotje-kinable Great! You're welcome :) Blade views are compiled to optimize performance, when developing, after editing blade files, it is a good idea to run The Laravel doc is here https://laravel.com/docs/11.x/views#optimizing-views |
@jeffchown I thought they always recompile when using vite! thanks for the tip! |
@lotje-kinable Vite does refresh 'normal' Blade file changes when running So, if something doesn't work as I expect after an edit, I run As for 2 |
@jeffchown I'll keep it in mind, thanks for the explanations! Maybe I am doing something wrong with the flux:select tbh, I worked with the teleport and now I have put the flux:modal outside of the table, and open/close it with livewire (which is slower). But the error: module.cjs.js:354 Uncaught TypeError: to.setAttribute is not a function keeps popping up when I uncomment the foreach section of the flux:select! The options in the foreach are bound to a computed property and when I toggle the radio, it pops up. But when I comment the flux:select in either of the solutions, the error goes away! |
@lotje-kinable You're welcome. At this point, I can't recreate the error (your code with the select uncommented works for me - with |
@jeffchown It seems to work, with the error in the console, so maybe it is something internal. Just curious: Can you see the error in you console? I wrapped the flux:modal with wire:model.self="showModal" in an @if($showModal) and the error is gone! Maybe it was trying to load the flux:select values when the page loaded or something... |
@lotje-kinable Sounds like you are working with different code than the example you provided as there is no No errors in my console when using your example, with the changes we've been discussing. |
@jeffchown well, yes, instead of using teleport, I put the modal outside of the flux:table, and open it with livewire. Since I still got the errors with teleport after running the command, I thought I would try something else. Thanks for confirming. I still get the errors with teleport, in my Volt component. (after view:clear + npm run build) |
Hi 👋
I have
checkbox/radio to change the items in the foreach
a foreach in a flux:table
with a trigger - modal (with :name="name-$option->id" as instructed)
that contains a flux:select ( with wire:key="select-choice-{{$choice->id}}" set)
a screencast
a Volt component (sorry about the code, I need all of it, to recreate the issue I am having on my production project)
The Issue:
On my actual project, the data does not load when changing the value of the radio or checkbox, when the SELECT inside the modal is commented out, the error dissapears and all works as expected.
I don't think that having a flux:select inside a modal is prohibited or weird. I hope it will work because it is superfast!
The error:
Cannot redifine property: disabled
flux.js?id=5b5b9c60:2262 Uncaught TypeError: Cannot redefine property: disabled
at Function.defineProperty ()
at Disableable.boot (flux.js?id=5b5b9c60:2262:14)
at new Mixin (flux.js?id=5b5b9c60:1799:18)
at new Disableable (flux.js?id=5b5b9c60:2259:21)
at HTMLElement.mount (flux.js?id=5b5b9c60:4745:27)
at flux.js?id=5b5b9c60:1745:21
cannot.redefine.disabled.mov
It is hard to explain, so I hope I've provided enough information!
Thanks in advance!
The text was updated successfully, but these errors were encountered: