mirror of
https://github.com/flarum/framework.git
synced 2025-04-24 21:54:04 +08:00
Fix dropdown going off top of screen
The previous solution didn't properly account for document scroll, so when replying to posts, the parent offset would be extremely large, and it'd fall back to the top coordinate, which is out of bounds on small screens.
This commit is contained in:
parent
302687b11a
commit
0ad97bb4ed
@ -172,7 +172,7 @@ export default function addComposerAutocomplete() {
|
||||
}
|
||||
|
||||
// Prevent the dropdown from going off screen on mobile
|
||||
top = Math.max(-parent.offset().top, top);
|
||||
top = Math.max(-(parent.offset().top - $(document).scrollTop()), top);
|
||||
left = Math.max(-parent.offset().left, left);
|
||||
|
||||
dropdown.show(left, top);
|
||||
|
Loading…
x
Reference in New Issue
Block a user