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

EasyMDE and Trix Editor vanishing with Livewire Validation #80

Closed
Xinecraft opened this issue Sep 30, 2020 · 7 comments · Fixed by #159
Closed

EasyMDE and Trix Editor vanishing with Livewire Validation #80

Xinecraft opened this issue Sep 30, 2020 · 7 comments · Fixed by #159
Labels
bug Something isn't working

Comments

@Xinecraft
Copy link

Hi there,
I am trying to add live validation on a form and whenever any part of the form changes the EasyMDE editor just become normal textarea.
Am I missing something which I can't find in docs?

Reference:
https://i.imgur.com/0RYUtT6.gif

@RomainMazB
Copy link

RomainMazB commented Oct 3, 2020

Hi,
You're not missing anything.

The problem comes from the fact Livewire re-render the Dom and the javascript initialization isn't applied anymore to the regenerated Dom.

I've faced the problem. We need to wrap the trix-editor tag into a div with the wire:ignore attributes.

Same trick will fix easyMDE.

will PR on it probably today.

@xewl
Copy link

xewl commented Oct 19, 2020

+1 - Also, the trix editor doesn't even seem to take wire:model into initial consideration & updates to it are 1 character behind.

@kurucu
Copy link

kurucu commented Jun 3, 2021

Hi @Xinecraft,
You might want to check out my SO answer, which deals with exactly this.
I hope that helps.
It might also kick-start @RomainMazB's PR.

@martin-ro
Copy link

Wrap the component in <div wire:ignore> ... </div>
See Livewire docs

@alexmanase
Copy link
Contributor

@driesvints I can create a PR to fix this issue. Is it worth it?

@driesvints
Copy link
Member

@alexmanase yes I believe so. Would appreciate it!

@driesvints
Copy link
Member

This should be fixed now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

7 participants