mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 03:59:39 +08: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:
parent
8214638cb5
commit
2e9c184b3b
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user