slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.52k stars 3.38k forks source link

2 editor 1 page #3671

Closed cramy25 closed 8 months ago

cramy25 commented 2 years ago

Hi, I have succesfully added 2 editors in 1 page, my issue is that when entering text only the second editor is taken in consideration.

Like if the text enter in the second editor is erasing the 1 editor.

So in my data base I have 2 columns for each editor, column 1 for editor 1 and 2 for editor 2, I enter different info in each editor and send them to the database, it ends up having the data of the 2nd editor in the 1st column.

Any idea on this behaving?

vladislavkoz commented 1 year ago

You need to use different identificators for them.

benbro commented 8 months ago
<div id="editor-container-1">
</div>
<div id="editor-container-2">
</div>
var quill1 = new Quill('#editor-container-1', {
  modules: {
    toolbar: [
      [{ header: [1, 2, false] }],
      ['bold', 'italic', 'underline'],
      ['image', 'code-block']
    ]
  },
  placeholder: 'Compose an epic...',
  theme: 'snow'  // or 'bubble'
});

var quill2 = new Quill('#editor-container-2', {
  modules: {
    toolbar: [
      [{ header: [1, 2, false] }],
      ['bold', 'italic', 'underline'],
      ['image', 'code-block']
    ]
  },
  placeholder: 'Compose an epic...',
  theme: 'snow'  // or 'bubble'
});