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

Required manual select components do not expand #267

Closed
BeBel42 opened this issue May 18, 2024 · 3 comments
Closed

Required manual select components do not expand #267

BeBel42 opened this issue May 18, 2024 · 3 comments

Comments

@BeBel42
Copy link
Contributor

BeBel42 commented May 18, 2024

Hi,

I have copied-pasted the manual select component into my code.

Adding required="true" to it prevents it to expand.

<x-bladewind::select name="gender" placeholder="Select Gender" data="manual">
     <x-bladewind::select-item label="Male" value="male" />
     <x-bladewind::select-item label="Female" value="female" />
     <x-bladewind::select-item label="Prefer not to say" value="other" />
</x-bladewind::select>
<x-bladewind::select name="gender" required="true" placeholder="Select Gender" data="manual">
     <x-bladewind::select-item label="Male" value="male" />
     <x-bladewind::select-item label="Female" value="female" />
     <x-bladewind::select-item label="Prefer not to say" value="other" />
</x-bladewind::select>

The first one works, the second does not.

Any way to fix this?

@mkocansey
Copy link
Owner

mkocansey commented May 18, 2024

@BeBel42
If you have two selects with the same name in the same page, the second will not work. Each select field needs to have a unique name.

However, if you only provided the two select codes to make your point, I'll look into this and fix.

@mkocansey
Copy link
Owner

mkocansey commented May 18, 2024

@BeBel42 Can you try making this dynamic let me know if it works?

<?php
 $gender = [
    [ 'label' => 'Male','value' => 'male' ],
    [ 'label' => 'Female','value' => 'female' ],
    [ 'label' => 'Prefer not to say','value' => 'other' ],
];
?>
<x-bladewind::select required="true" name="gender" :data="$gender" />

@BeBel42
Copy link
Contributor Author

BeBel42 commented May 19, 2024

Hi,

I apologize. The two names being the same was indeed the issue.

So it's a mistake on my part for this one 😓

I'll close the issue. Again, sorry for the false alert.

@BeBel42 BeBel42 closed this as completed May 19, 2024
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