Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Data binding only works one way #2

Closed
Haxxer opened this issue Feb 28, 2021 · 2 comments
Closed

Data binding only works one way #2

Haxxer opened this issue Feb 28, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Haxxer
Copy link

Haxxer commented Feb 28, 2021

Hey,

We've been running into some problems getting data out of the editor. We can put data into it easy enough, but any references to content in any other model doesn't seem to update.

A simple test would be to use the test file you provide, and adding an additional div with x-html="content" on it, and when typing into the editor the content of the element won't update.

Lemme know if you need anything else.

Cheers.

@Haxxer Haxxer changed the title Data binding working only works one way Data binding only works one way Mar 3, 2021
@dashpilot
Copy link

I ran into the same issue. As a quick fix you could listen for the @input event of the editor, and update the model accordingly, for example:

<div data-type="editor" class="p-2" x-on:input="item.body = document.querySelectorAll('.ProseMirror')[0].innerHTML"></div>

@maxeckel
Copy link
Owner

Hey Folks,

this Bug is fixed now in v0.3.2. Thank you both for reporting this!

Cheers!

@maxeckel maxeckel self-assigned this Mar 14, 2021
@maxeckel maxeckel added the bug Something isn't working label Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants