-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Question: Why does the editor not reset when i reset test from v-model:content="test" #35
Comments
try setHTML instead of setting the value of content |
🎉 This issue has been resolved in version 1.0.0-beta.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks for reporting the issue and sorry for the delayed reply. I have resolved this issue in version 1.0.0-beta.6 |
Thanks for the fix, I really appreciate it. I'm just wondering, the cursor seems to reset to position 1 whenever I type something while v-model:content is set. Do you know anything about that? |
Before assigning a value to quill editor content, set the focus not to be allowed. Reopen enable after assignment
|
Fixed it (revert to the previews code), but when you reset the |
The snippets: <template>
<QuillEditor
ref="myEditor"
v-model:content="myContent"
content-type="html"
/>
<button @click="resetContent">Reset</button>
</template>
<script>
import { QuillEditor } from '@vueup/vue-quill'
export default {
components: {
QuillEditor,
},
data() {
return {
myContent: 'test'
}
},
methods: {
resetContent() {
this.$refs.myEditor.setHTML('')
}
}
};
</script> |
Thanks for your quick answers. Somehow I'm not able to accomplish what I want to do. Let me tell you what I'm playing around with:
The problem:
Here's my code at the current state:
I've removed the other inputs, selects and so on. |
v-model:content would be perfect if the cursor stayed were it was. However, I don't know how hard that is to implement. I'm happy to help. |
how can I use setHtml in the latest beta release?? |
I encountered a similar issue yesterday. Needed to update the displayed editor content after fetching new data. Didn't get it to work until I put the editor right into the component fetching the data (so there's no events in between), attached No cursor issues that way; I also encountered them when working with the editor in its own compenent, using props/emit() to communicate with the parent. PS:
then you can use |
Adding an issue that I had today, just in case it helps anyone. I couldn't get v-model:content to work. The name of the variable that I was using was "content", so the code was
Tried everything I could think of and just couldn't get it working, then I changed the variable name to anything other than "content" and it worked, like this
|
Great Help, I just spent much time on this. It seems the content is not rendered. |
@vueup/vue-quill version [e.g. 1.0.0-beta.7]
Throw error |
Can you show the example please? It's still buggy for me |
Sure @bulich - line 104 in this component here: https://github.com/ttntm/recept0r-ts/blob/main/src/views/RecipeEditable.vue Haven't had any issues using it this way since posting my initial comment. |
you can uncomment the watchers from the node model and it will work for the test :
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
🎉 This issue has been resolved in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
i get the same case. if you close and back from another page you need to close QuillEditor component, and if you open open page form you should open QuillEditor component, give v-if condition. below my code:
|
same for me... also in 1.0.0 if i update the v-model:content the quill editor still show "undefined" i need to manualy update with a watch() of the object and fire a setHTML .. |
I have tried with setHTML() it works, but i got problem with cursor. I try another way here what i did below index.vue
CustomQuillEditor.vue
Noted: this snippet code will initial value |
The editor doesn't change when it's v-model variable changes. Why is that?
So testReset() does nothing visual in this example.
Code:
The text was updated successfully, but these errors were encountered: