You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to change the positioningStrategy of the mentions dropdown list. When the window size is greater or than equal to 640px the positioningStrategy should be fixed. However, when the window size is less than 640px the positioningStrategy should be normal.
const initializeQuill = () => {
console.log('Initializing Quill...')
if(quillInstance.value) {
quillInstance.value = null;
}
// Register each module
modules.forEach(module => {
delete Quill.imports[`modules/${module.name}`];
});
// Register each module
modules.forEach(module => {
Quill.register(`modules/${module.name}`, module.module);
});
quillInstance.value = new Quill(`#editor-${props.commentId}`, {
theme: 'snow',
modules: {
toolbar: `#toolbar-${props.commentId}`,
...modules.reduce((acc, module) => ({ ...acc, [module.name]: module.options }), {}),
}
});
// TODO (later): Save content in store and restore it when editor is opened again
quillInstance.value.focus();
const length = quillInstance.value.getLength();
quillInstance.value.setSelection(length, length);
quillInstance.value.on('text-change', () => {
content.value = quillInstance.value.root.innerHTML;
});
};
However, the positioningStrategy of the mentions module does not change event though I have reinitialize the editor. How can this be? How can I get a workaround on this to have the mentions list fixed for sizes equal or greater than 640px and normal for sizes less than 640px?
I appreciate any kind of help!
Kind regards.
The text was updated successfully, but these errors were encountered:
Hey there,
I would like to change the positioningStrategy of the mentions dropdown list. When the window size is greater or than equal to
640px
the positioningStrategy should befixed
. However, when the window size is less than640px
the positioningStrategy should benormal
.This is my modules array:
The variable
windowWidth
is just aref
variable being refreshed with awindow.addEventListener
every time the window resizes.I also reinitialize my quill editor every time fresh, when the window size drops below
640px
or becomes greater/equal to640px
. Here is how I do that:And here is my
initializeQuill
method:However, the positioningStrategy of the mentions module does not change event though I have reinitialize the editor. How can this be? How can I get a workaround on this to have the mentions list
fixed
for sizes equal or greater than640px
andnormal
for sizes less than640px
?I appreciate any kind of help!
Kind regards.
The text was updated successfully, but these errors were encountered: