Open modal automatically after page component loaded #263
Replies: 2 comments
-
I think it will work if you add it to the blade file of your component instead: @if((session('upload-facebook')))
<script>Livewire.emit('openModal', 'videos.upload.facebook-upload', [session('upload-facebook')])</script>
@endif |
Beta Was this translation helpful? Give feedback.
0 replies
-
@if ($browseNewsId = session('autoBrowseNewsId'))
@push('scripts')
<script>
document.addEventListener('alpine:initialized', () => {
Livewire.emit("openModal", "show-news", {!! json_encode(["newsId" => $browseNewsId]) !!});
});
</script>
@endpush
@endif |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
howdu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In a standard livewire page component how can I automatically open a modal?
Tried this but nothing hapens:
Reason being that I have a table of videos with a button that opens a modal.
Before opening the modal it calls another action which checks the user has permision to post to facebook. If not it will redirect to facebook.
The problem I have is that when redreting back from facebook how can I trigger the modal to open automatically without the user having to click the modal button again.
Beta Was this translation helpful? Give feedback.
All reactions