quill
quill copied to clipboard
Page scrolls when setting editor direction
When setting editor direction to rtl the page scrolls to the editor element immediately
editor.format('align', 'right'); editor.format('direction', 'rtl');
Hi @MustafaMohamed2018 You can prevent unintended scroll by quill when clicking alignment toolbar like this
let lastScroll = window.pageYOffset;
window.onscroll = () => {
lastScroll = scrollDetection(lastScroll);
}
const toolbar = document.querySelector('.ql-toolbar');
toolbar?.addEventListener('click', (e) => {
window.scrollTo(0, lastScroll);
});