mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 05:00:19 +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
e83b88d17d
commit
40a0f2e0c9
|
@ -148,7 +148,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…
Reference in New Issue
Block a user