mirror of
https://github.com/flarum/core.git
synced 2025-07-24 10:11:43 +02:00
Fix positioning of mention dropdown
Previously, the positioning logic did not account for the case when the textarea was already scrolled down a bit, thus often rendering the dropdown off-screen. Fixes flarum/core#1021.
This commit is contained in:
@@ -153,9 +153,9 @@ export default function addComposerAutocomplete() {
|
||||
const height = dropdown.$().outerHeight();
|
||||
const parent = dropdown.$().offsetParent();
|
||||
let left = coordinates.left;
|
||||
let top = coordinates.top + 15;
|
||||
let top = coordinates.top - this.scrollTop + 15;
|
||||
if (top + height > parent.height()) {
|
||||
top = coordinates.top - height - 15;
|
||||
top = coordinates.top - this.scrollTop - height - 15;
|
||||
}
|
||||
if (left + width > parent.width()) {
|
||||
left = parent.width() - width;
|
||||
|
Reference in New Issue
Block a user