We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Move dropdown position above and below inside editor.
_getBalloonPosition() { const editor = this.editor; const view = editor.editing.view; const viewDocument = view.document; const viewportHeight = window.innerHeight; const editorRect = editor.ui.view.editable.element.getBoundingClientRect(); const editorBottom = editorRect.bottom;
const target = () => { const range = view.domConverter.viewRangeToDom(viewDocument.selection.getFirstRange()); const rect = range.getBoundingClientRect(); if (rect.top === 0 && rect.left === 0 && rect.height === 0 && rect.width === 0) { return this._getEditorPosition(editorRect, viewportHeight); } let top = rect.top + rect.height + 10; if (top + 100 > editorBottom) { top = rect.top - 100 - 10; } if (top + 100 > viewportHeight) { top = viewportHeight - 100 - 10; } if (top < 100) { top = 100; } const left = Math.max(rect.left, editorRect.left); const right = Math.min(rect.right, editorRect.right); return { top, left, right }; }; return { target }; } _getEditorPosition(editorRect, viewportHeight) { let top = editorRect.top + editorRect.height + 10; if (top + 100 > viewportHeight) { top = viewportHeight - 100 - 10; } const left = editorRect.left; const right = editorRect.right; return {left, right }; }
actual outpt: ![Image](https://github.com/user-attachments/assets/2c525eea-66![Image](https://github.com/user-attachments/assets/54491f98-8d48-40df-adc5-c2173d6b0a29) 7f-4b83-8e0a-343670cdd0cf)
expected output:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
📝 Ask a question
Move dropdown position above and below inside editor.
_getBalloonPosition() {
const editor = this.editor;
const view = editor.editing.view;
const viewDocument = view.document;
const viewportHeight = window.innerHeight;
const editorRect = editor.ui.view.editable.element.getBoundingClientRect();
const editorBottom = editorRect.bottom;
actual outpt:
![Image](https://github.com/user-attachments/assets/2c525eea-66![Image](https://github.com/user-attachments/assets/54491f98-8d48-40df-adc5-c2173d6b0a29)
7f-4b83-8e0a-343670cdd0cf)
expected output:
The text was updated successfully, but these errors were encountered: