-
Notifications
You must be signed in to change notification settings - Fork 44
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
Scroll lock styles not being cleaned up on Navigate #839
Comments
I think the same issue is affecting links inside of a modal as <flux:modal.trigger name="example">
<flux:button>Example</flux:button>
</flux:modal.trigger>
<flux:modal name="example">
<flux:button href="example/route" wire:navigate>
Example
</flux:button>
</flux:modal> |
@Awesomolocity and @decantr thanks for reporting! I can confirm this is happening. At the moment the lockStroll styles are not being cleaned up on page navigate. Below is a Volt component that demonstrates the issue. Make sure to have
@calebporzio I'm guessing we should set up a way to clean up flux stuff, so then a navigate listener can be set up to call that. <?php
use Livewire\Volt\Component;
new class extends Component
{
//
};
?>
<div>
<div class="h-screen">Some long content to demonstrate the scroll not working</div>
<flux:modal.trigger name="example">
<flux:button>Launch modal</flux:button>
</flux:modal.trigger>
<flux:modal name="example">
<flux:button :href="request()->url()" wire:navigate>
Go to me
</flux:button>
</flux:modal>
<div class="h-screen">Some morelong content to demonstrate the scroll not working</div>
</div> |
This sounds like it might be directly related to the issue that is also happening to me. Building my application I'm encountering problems where I can not scroll to content when it is past the visible window. After reading this issue, I can confirm that the behaviour I'm experiencing starts after I either use a flux:modal that uses a redirect in the component with navigate: true after modal confirmation, or if I use a flux:menu.item in a flux:dropdown to wire:navigate to another page. Any page I navigate to after using the dropdown or modal, that has content that extends beyond the visible browser window, I cannot scroll to it. Changing to flux:navmenu and flux:navmenut.item fixes the dropdown to navigate issue, but not the modal issue. Update: I just discovered that using a flux:modal as a delete button (with warning), in a table, renders the table un-scrollable after using (without any navigation redirect used). When visiting other pages, scroll behaviour remains broken. |
Flux version
v1.0.29
Livewire version
3.5.17
What is the problem?
If you use
flux:menu
withinflux:dropdown
, it'll addoverflow:hidden
to the root HTML element.This style attribute persists if you then
wire:navigate
away from the page, which is probably not desirable behavior.You may say "Well obviously! It says to utilize
flux:navmenu
on the dropdown documentation page for this exactly reason". Which is true, however, is pretty easy to miss if you are copying your navbar directly from the header documentation page, which uses this exact type of menu (it doesn't includewire:navigate
- but also doesn't include any warning about theoverflow:hidden
behavior)Code snippets
Results in
overflow:hidden
persisting on root html element when navigating to ProfileHow do you expect it to work?
I'd either expect
overflow:hidden
to be removed from the element when navigating to a different page, OR for this possibly unexpected behavior to be more prominent within the documentation so that I could appropriately chooseflux:navmenu
as the sub-item and not experience this behavior.Please confirm (incomplete submissions will not be addressed)
The text was updated successfully, but these errors were encountered: