mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
Make sure the emoji popup doesn't go off the top of the screen on mobile
This commit is contained in:
@@ -11,7 +11,6 @@ import KeyboardNavigatable from 'flarum/utils/KeyboardNavigatable';
|
|||||||
import AutocompleteDropdown from './components/AutocompleteDropdown';
|
import AutocompleteDropdown from './components/AutocompleteDropdown';
|
||||||
|
|
||||||
export default function addComposerAutocomplete() {
|
export default function addComposerAutocomplete() {
|
||||||
|
|
||||||
const emojiKeys = Object.keys(emojiMap);
|
const emojiKeys = Object.keys(emojiMap);
|
||||||
|
|
||||||
extend(ComposerBody.prototype, 'config', function(original, isInitialized) {
|
extend(ComposerBody.prototype, 'config', function(original, isInitialized) {
|
||||||
@@ -150,6 +149,8 @@ export default function addComposerAutocomplete() {
|
|||||||
if (left + width > parent.width()) {
|
if (left + width > parent.width()) {
|
||||||
left = parent.width() - width;
|
left = parent.width() - width;
|
||||||
}
|
}
|
||||||
|
top = Math.max(-$(this).offset().top, top);
|
||||||
|
left = Math.max(-$(this).offset().left, left);
|
||||||
dropdown.show(left, top);
|
dropdown.show(left, top);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user