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

Make easyMDE and Trix compatible with Livewire 3 #159

Merged

Conversation

alexmanase
Copy link
Contributor

Fixes #80

src/BladeUIKit.php Outdated Show resolved Hide resolved
@@ -57,6 +57,10 @@ public static function outputScripts(bool $force = false): string
->sort(fn (string $script) => str($script)->contains('alpine') ? 1 : 0)
->map(function (string $script) {
if (str($script)->contains('alpine')) {
if (config('livewire.inject_assets') && !app()->runningUnitTests()) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya, could you explain why you needed to add this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if we have Livewire installed it will inject Alpine JS automatically on every page, so there is not need to include Alpine script if inject_assets is true.

The Dusk tests use Livewire and won't work if Alpine JS in not loaded, so I think in testing environment it's ok to have the Alpine script.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks @alexmanase

@driesvints driesvints force-pushed the fix-livewire-easymde-and-trix branch from 8ff1dcf to c23c7ef Compare April 4, 2024 12:53
@driesvints driesvints merged commit 5b488fd into blade-ui-kit:main Apr 4, 2024
6 checks passed
@driesvints
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

EasyMDE and Trix Editor vanishing with Livewire Validation
2 participants