Fix following by bubble beside button on mobiles
This commit is contained in:
parent
c717fd9ea2
commit
c7a21360ee
@ -80,7 +80,7 @@ export default class ChatContextMenu {
|
||||
const className = (e.target as HTMLElement).className;
|
||||
if(!className || !className.includes) return;
|
||||
|
||||
const good = ['bubble', 'bubble__container', 'message', 'time', 'inner'].find(c => className.includes(c));
|
||||
const good = ['bubble', 'bubble__container', 'message', 'time', 'inner'].find(c => className.match(new RegExp(c + '($|\\s)')));
|
||||
if(good) {
|
||||
onContextMenu(e);
|
||||
}
|
||||
|
@ -228,6 +228,7 @@ export function positionMenu({clientX, clientY}: {clientX: number, clientY: numb
|
||||
}
|
||||
|
||||
// ! don't need reverse for this, this will be the side WHERE ANIMATION WILL END !
|
||||
// ! NO LOGIC HERE !
|
||||
let verticalSide: 'top' | 'bottom';
|
||||
|
||||
if(side !== undefined) {
|
||||
@ -251,7 +252,7 @@ export function positionMenu({clientX, clientY}: {clientX: number, clientY: numb
|
||||
}
|
||||
|
||||
if((clientY + scrollHeight + PADDING_TOP) > innerHeight) {
|
||||
elem.style.top = Math.max(PADDING_TOP, clientY - scrollHeight) + 'px';
|
||||
elem.style.top = clamp(clientY - scrollHeight, PADDING_TOP, innerHeight - scrollHeight - PADDING_TOP) + 'px';
|
||||
// elem.style.top = (innerHeight - scrollHeight - PADDING_TOP) + 'px';
|
||||
verticalSide = 'top';
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user