mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 05:11:55 +01:00
Message Context Menu: Open system menu for links on mobiles (#1325)
This commit is contained in:
parent
383e00c4fa
commit
752d9a4df7
@ -89,9 +89,9 @@ export default (
|
||||
const emulateContextMenuEvent = (originalEvent: TouchEvent) => {
|
||||
clearLongPressTimer();
|
||||
|
||||
const { clientX, clientY } = originalEvent.touches[0];
|
||||
const { clientX, clientY, target } = originalEvent.touches[0];
|
||||
|
||||
if (contextMenuPosition) {
|
||||
if (contextMenuPosition || (shouldDisableOnLink && (target as HTMLElement).matches('a.text-entity-link[href]'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ export default (
|
||||
element.removeEventListener('touchend', clearLongPressTimer, true);
|
||||
element.removeEventListener('touchmove', clearLongPressTimer);
|
||||
};
|
||||
}, [contextMenuPosition, isMenuDisabled, shouldDisableOnLongTap, elementRef]);
|
||||
}, [contextMenuPosition, isMenuDisabled, shouldDisableOnLongTap, elementRef, shouldDisableOnLink]);
|
||||
|
||||
return {
|
||||
isContextMenuOpen,
|
||||
|
Loading…
x
Reference in New Issue
Block a user