Fix featured activities filters by moving the calendar outside the Vue root - #3658
Merged
Merged
Conversation
Vue mounts on <main id="app"> with the runtime compiler, which clears the container and rebuilds every node from the server HTML. That happens about 18ms after Livewire initialises, so the visible filters were copies carrying wire: attributes but none of Livewire's event listeners. Changing a filter produced no request at all and no error. Move the component into the existing non-vue region, which Vue never touches. Also drop indexes before their columns in two support-table migrations, since SQLite refuses to drop an indexed column and this broke rollback for the whole test suite. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@livewire('online-calendar')in@section('non-vue-content')instead of@section('content')<main id="non-vue">support_*migrations so the test suite can roll back on SQLiteRoot cause
The filters were never reaching Livewire at all. On the live page, changing the month produced no network request and no JavaScript error, while
Livewire.find(...).get('selectedDate')stayedall.The reason is that the element Livewire is bound to is not the element on the page:
falsefalse__livewirefalseresources/js/app.jscallscreateApp({}).mount('#app'), andvite.config.jsaliasesvuetovue/dist/vue.esm-bundler.js. With the runtime compiler and notemplate/renderoption, Vue uses the container'sinnerHTMLas its template, setscontainer.innerHTML = '', and rebuilds every node. A pre-load trace of the page confirms the ordering:The selects on screen are Vue-created copies that still carry
wire:model.livebut have no listeners, so they are inert. Pagination kept working only because those are plain links.The layout already provides
<main id="non-vue">as a sibling of<main id="app">for exactly this situation, and it is already used byhome,profile,community,event/showandevent/search. Verified on production that nodes inside#non-vuesurvive Vue's mount.Known related issue (not fixed here)
Every other Livewire component rendered inside
#apphas the same defect, including<livewire:map-wire>and the admin tables. Worth a follow-up; a global alternative would be deferring Livewire's script so it boots after Vue mounts.Test plan
php artisan test tests/Feature/OnlineEventsWorkflowTest.php— 13 passed@section('content')Made with Cursor