mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-03 02:10:55 +00:00
Fix emoji & mention selector menu positioning in note editor
This commit is contained in:
parent
4a76187d96
commit
154e9679b7
@ -576,7 +576,13 @@ const EditBox: Component<{
|
||||
const taRect = textArea.getBoundingClientRect();
|
||||
const wRect = editWrap.getBoundingClientRect();
|
||||
|
||||
let newTop = taRect.top - wRect.top + mentionCursorPosition.top + 22;
|
||||
let mTop = mentionCursorPosition.top;
|
||||
|
||||
if (textArea.scrollTop > 0) {
|
||||
mTop -= textArea.scrollTop;
|
||||
}
|
||||
|
||||
let newTop = taRect.top - wRect.top + mTop + 22;
|
||||
let newLeft = mentionCursorPosition.left + 16;
|
||||
|
||||
if (newTop > document.documentElement.clientHeight - 200) {
|
||||
@ -595,7 +601,13 @@ const EditBox: Component<{
|
||||
const taRect = textArea.getBoundingClientRect();
|
||||
const wRect = editWrap.getBoundingClientRect();
|
||||
|
||||
let newTop = taRect.top - wRect.top + emojiCursorPosition.top + 22;
|
||||
let mTop = emojiCursorPosition.top;
|
||||
|
||||
if (textArea.scrollTop > 0) {
|
||||
mTop -= textArea.scrollTop;
|
||||
}
|
||||
|
||||
let newTop = taRect.top - wRect.top + mTop + 22;
|
||||
let newLeft = emojiCursorPosition.left;
|
||||
|
||||
if (newTop > document.documentElement.clientHeight - 200) {
|
||||
|
Loading…
Reference in New Issue
Block a user