-
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
Custom component to wrap flux:select multiple
doesn't render flux:option
s properly
#678
Comments
That's weird, we do this with every Flux component and haven't seen this before. We even do multi inheritance if that's a word/thing. I haven't got much time this evening but will tinker a bit tomorrow morning to see if I can replicate this. |
@ju5t Agreed. I've wrapped other Flux components without issue. Thanks! Here's hoping we can get this working. |
UPDATE: It seems the issue is the Therefore, the Now the trick is to figure out why the UPDATE: Of course, it is in the Laravel docs:
So, given the above, how can I 'wrap' the I'm essentially trying to reduce this e.g.:
to this:
as I have a lot of multiselects in some large forms so I want to keep my code concise and consistent, and I want to make it easy for me to make global changes to all of the multiselects by editing the one custom component blade file (vs. having to change each multiselect separately) @calebporzio Your insight(s) here would be much appreciated. |
Because of the way views/components/multiselect.blade.php
views/components/multioption.blade.php
Then, I can use the components in my forms via e.g.:
While this works, I'm open to feedback/ideas :) |
Hi all,
@calebporzio This might not be an issue but instead my not understanding the order in which Blade interpolation occurs (or something along those lines).
In order to make my code more concise when using the new
flux:select multiple
functionality, I have created a custom component that 'wraps'flux:select
. My component is as follows:resources/views/components/multiselect.blade.php
So I can call it in my views via
<x-multiselect ... />
When I use my new component, the
flux:option
s do not render properly (obvious because the styling doesn't match a normalflux:option
), nor are they selectable.For example, if in my view I have:
For the first 'native'
flux:select
, the options render and work properly to show:but the 2nd select, using my
x-multiselect
component does not render the options properly, and they are not selectable:Inspecting the results in devtools shows multiple differences in the code generated by the examples above - most notably, no
ui-option
s are in the markup for the 2nd select.There may be something I'm missing or do not understand, but I'd really like to figure this one out as it will help me greatly simplify my code for some very complex forms that use many multiple select inputs.
Thanks in advance for any help/insights!
The text was updated successfully, but these errors were encountered: