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

Not working in action modal #6

Closed
martin-ro opened this issue Aug 26, 2022 · 12 comments
Closed

Not working in action modal #6

martin-ro opened this issue Aug 26, 2022 · 12 comments

Comments

@martin-ro
Copy link

When using the field in an action modal I get

Alpine Expression Error: mode is not defined

Expression: "mode ==='dark'"

<template x-if="mode ==='dark'">
@martin-ro
Copy link
Author

I should add that this is with a table action outside of admin panel

@coolsam726
Copy link
Contributor

coolsam726 commented Aug 26, 2022 via email

@martin-ro
Copy link
Author

Hi,

it's just a livewire component implementing Tables\Contracts\HasTable and in getTableActions

Tables\Actions\Action::make('book')
                ->label(__('Book Lesson'))
                ->mountUsing(fn (Forms\ComponentContainer $form, Teacher $record) => $form->fill([
                    'teacher_id' => $record->user->userable_id,
                ]))
                ->form([
                    Group::make()->schema([
                        Flatpickr::make('date),
                    ])->columns(2),
                ])

@martin-ro
Copy link
Author

If you want to reproduce, just create a Livewire component and setup a table like here

and in the tables getTableActions create a modal action with the Flatpickr field. I hope you know what I mean? I can't really post the whole component :)

@martin-ro
Copy link
Author

Ok, digging around a bit, all the assets are registered FlatpickrServiceProvider which means they are only loaded within Filament but not in a standalone form or table component.

@coolsam726
Copy link
Contributor

Ok, digging around a bit, all the assets are registered FlatpickrServiceProvider which means they are only loaded within Filament but not in a standalone form or table component.

This is actually the case. Might you be able to do a PR to support standalone usage?

@R00118189
Copy link

Any update?

@coolsam726
Copy link
Contributor

coolsam726 commented Jan 1, 2023 via email

@R00118189
Copy link

R00118189 commented Jan 28, 2023

@coolsam726 I wonder if you had a chance to update this package to work with standalone forms

@dkstudio86
Copy link

@coolsam726 I wonder if you had a chance to update this package to work with standalone forms

+1

1 similar comment
@Haggai-Mac
Copy link

@coolsam726 I wonder if you had a chance to update this package to work with standalone forms

+1

coolsam726 added a commit that referenced this issue Jul 27, 2023
## 2.x dev - Full Re-Write of the package, with bug fixes:

### Improvements and Fixes:
1. Dark mode is now enabled on the fly for the FilamentPHP admin panel.
2. The package can now be used in standalone forms outside the filament admin panel. Fixes #1, #2, #6, #23
3. Almost all of Flatpickr's native configuration is now supported out of the box through a fluent interface. Fixes #10, #11, #24
3. Alpine.js component is now loading lazily using async-alpine
@coolsam726
Copy link
Contributor

Fixed in this PR #27

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

5 participants