-
Notifications
You must be signed in to change notification settings - Fork 47
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
Duplicate place holder in listbox select #777
Comments
Can confirm, I have had this happen to me as well. I used the following hack to trigger a page reload to remove the duplications. Not ideal, but a [current] workaround in my case @script
<script>
window.onpopstate = function () {
window.location.reload(true)
};
</script>
@endscript |
@zoonix Can you provide a full code example that can be copy/pasted to reproduce the issue? (Volt components are great for this) |
Just add the listbox variant to any flux:select, click any link to another page on the app and then click the back button.
And you will get a duplicate placeholder |
@zoonix Using your code and a link to another page in my test app, then the back button, after multiple attempts, I'm unable to reproduce the issue. Have you |
I started fresh install...
Install flux Added @fluxStyles and @fluxScripts to the head and body of the app.blade.php file Duplicated the dashboard route and component to create a new route and component called "sandbox", and added it to the navigation. Added the following to the sandbox.blade.php file:
The "Test" placeholder will duplicate when you click the Dashboard link and then click back. Reference repo... |
Ah, it only seems to happen when wire:navigate is used on the nav links. Change them to standard links and the issue stops. |
Just confirmed with my own project. Using |
Edit: Sorry just saw @zoonix that you actually had v1.0.28 in your description 😅 |
I can confirm this behaviour. To replicate, add this Volt component below to Then click on the "Playground" link, then hit the back button. <?php
use Livewire\Volt\Component;
new class extends Component {
//
}
?>
<div>
<flux:link href="/playground" wire:navigate>Playground</flux:link>
<flux:select variant="listbox" placeholder="Test...">
<flux:option value="10">10</flux:option>
<flux:option value="25">25</flux:option>
<flux:option value="50">50</flux:option>
<flux:option value="100">100</flux:option>
</flux:select>
</div> |
Opened a PR with a potential fix to remove any placeholders before we set another placeholder during navigation. It's very similar to the previous fix for #697 |
Update on this? I'm having the same issue with this code:
|
@RezaODB yep I've opened an alternative PR to TJs and hopefully Caleb should review it in time for the next release. |
When you create a select as a listbox, the place holder will stack multiple times when you hit the back button.
Works fine as new page load, refresh or wire:navigate, but if you go back it will duplicate the place holder...
Also works fine as a combobox or default and clearable doesn't seem to matter. Just when listbox is set.
Using flux, flux-pro 1.0.28
The text was updated successfully, but these errors were encountered: