Skip to content

Commit

Permalink
Merge pull request #229 from awcodes/fix/gridLayout-null
Browse files Browse the repository at this point in the history
Fix: pass editor to grid tool in floating menu
  • Loading branch information
awcodes authored Dec 4, 2023
2 parents c09a158 + b7260ba commit ae10959
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
'tools' => [],
'blocks' => [],
'shouldSupportBlocks' => false,
'editor' => null,
])

<div x-ref="defaultFloatingMenu" class="flex gap-1 items-center" x-cloak>
@if (in_array('media', $tools)) <x-filament-tiptap-editor::tools.media :state-path="$statePath"/> @endif
@if (in_array('grid', $tools)) <x-filament-tiptap-editor::tools.grid :state-path="$statePath"/> @endif
@if (in_array('grid', $tools)) <x-filament-tiptap-editor::tools.grid :state-path="$statePath" :editor="$editor"/> @endif
@if (in_array('grid-builder', $tools)) <x-filament-tiptap-editor::tools.grid-builder :state-path="$statePath"/> @endif
@if (in_array('details', $tools)) <x-filament-tiptap-editor::tools.details :state-path="$statePath"/> @endif
@if (in_array('table', $tools)) <x-filament-tiptap-editor::tools.table :state-path="$statePath"/> @endif
Expand Down
2 changes: 1 addition & 1 deletion resources/views/tiptap-editor.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class="relative z-0 tiptap-wrapper rounded-md bg-white dark:bg-gray-900 focus-wi
@endif

@if (! $isFloatingMenusDisabled() && filled($floatingMenuTools))
<x-filament-tiptap-editor::menus.default-floating-menu :state-path="$statePath" :tools="$floatingMenuTools" :blocks="$blocks" :should-support-blocks="$shouldSupportBlocks"/>
<x-filament-tiptap-editor::menus.default-floating-menu :state-path="$statePath" :tools="$floatingMenuTools" :blocks="$blocks" :should-support-blocks="$shouldSupportBlocks" :editor="$field"/>
@endif

<div class="flex h-full">
Expand Down

0 comments on commit ae10959

Please sign in to comment.