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

Incorrect Value in URI When Resetting Option in Select #907

Open
3 tasks done
gustavosobrinho01 opened this issue Dec 20, 2024 · 3 comments
Open
3 tasks done

Incorrect Value in URI When Resetting Option in Select #907

gustavosobrinho01 opened this issue Dec 20, 2024 · 3 comments

Comments

@gustavosobrinho01
Copy link

Flux version

v1.0.29

Livewire version

v3.5.16

What is the problem?

When using the select as shown in the code and images below, the screen loads with the value 0. When I select the “Ativos” option, the attribute value changes to 1. However, when switching back to the “All Status” option, the value should reset to 0, but as shown in the image, it displays as “Todos+os+Status”.

Image Image

Code snippets

<div>
    <flux:select wire:model="{{ $attributes->wire('model')->value }}"
                 wire:change="{{ $attributes->wire('change')->value }}">
        <flux:option value="0">Todos os Status</flux:option>
        <flux:option value="1">Ativos</flux:option>
        <flux:option value="2">Excluídos</flux:option>
    </flux:select>
</div>
<x-filters.status wire:model="statusSearch" wire:change="filter" autofocus/>

How do you expect it to work?

I expect the value in the URI to be set to 0, not “Todos+os+Status”.

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.
@gustavosobrinho01 gustavosobrinho01 changed the title Problem with select options Incorrect Value in URI When Resetting Option in Select Dec 20, 2024
@joshhanley
Copy link
Member

@gustavosobrinho01 thanks for reporting! Can you try using a value other than 0 and see if that works? I suspect there as an issue with how the select is handling a zero value

@gustavosobrinho01
Copy link
Author

With another value, it works, but it should also work with 0, as another value does not meet my needs.

@joshhanley
Copy link
Member

@gustavosobrinho01 yeah agreed, I just wanted to make sure it wasn’t an issue with the first item in the select vs a problem with a 0 value

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