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

Editor without toolbar does not work with wire:model #937

Open
3 tasks done
jradtilbrook opened this issue Dec 29, 2024 · 1 comment
Open
3 tasks done

Editor without toolbar does not work with wire:model #937

jradtilbrook opened this issue Dec 29, 2024 · 1 comment

Comments

@jradtilbrook
Copy link

Flux version

v1.1.0

Livewire version

v3.5.17

What is the problem?

I'd like to remove the toolbar from the editor and just use shortcuts or markdown and wire it to an attribute, but this does not work.

Code snippets

Works:

<flux:editor wire:model.live.debounce="post.content">
    <flux:editor.toolbar />
    <flux:editor.content />
</flux:editor>

As does:

<flux:editor wire:model.live.debounce="post.content" />

However, this does not:

<flux:editor wire:model.live.debounce="post.content">
    <flux:editor.content />
</flux:editor>

It renders as I would like and works to type into using markdown syntax, but the content is not wired to the model.

Note, I am using livewire 3 and have turned on the legacy eloquent binding as well. I don't think that is related because it works with the toolbar item.
I've also tried wiring it directly to the editor.content component with no success.

As a workaround, I have included the toolbar with class="hidden" which works as well.

How do you expect it to work?

Id expect either

<flux:editor wire:model.live.debounce="post.content">
    <flux:editor.content />
</flux:editor>

or

<flux:editor>
    <flux:editor.content wire:model.live.debounce="post.content" />
</flux:editor>

to work

Please confirm (incomplete submissions will not be addressed)

  • I have provided easy and step-by-step instructions to reproduce the bug.
  • I have provided code samples as text and NOT images.
  • I understand my bug report will be closed if I haven't met the criteria above.
@joshhanley
Copy link
Member

@jradtilbrook thanks for reporting! The editor component requires the toolbar to function correctly at this stage. At the moment a bunch of errors are thrown if it does not exist. I think including it and hiding it is a good work around for now. I will see if Caleb wants to support removing it all together.

Image

Volt component that demonstrates the issue

<?php

use Livewire\Volt\Component;

new class extends Component {
    public $content;
};

?>

<div>
    <flux:editor wire:model.live="content">
        <flux:editor.content />
    </flux:editor>

    {{ $content }}
</div>

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

2 participants