diff --git a/apps/web/src/components/views/messages/MLocationBody.tsx b/apps/web/src/components/views/messages/MLocationBody.tsx index a7f683780a..5dbc4afca4 100644 --- a/apps/web/src/components/views/messages/MLocationBody.tsx +++ b/apps/web/src/components/views/messages/MLocationBody.tsx @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com Please see LICENSE files in the repository root for full details. */ -import React from "react"; +import React, { useMemo } from "react"; import { type MatrixEvent, ClientEvent, type ClientEventHandlerMap } from "matrix-js-sdk/src/matrix"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; import { Tooltip } from "@vector-im/compound-web"; @@ -131,6 +131,9 @@ export const LocationBodyContent: React.FC = ({ onError, onClick, }) => { + // Find the message panel boundary so the tooltip hides when it would overlap the composer + const boundaryEl = useMemo(() => document.querySelector(".mx_RoomView_messagePanel") ?? undefined, []); + // only pass member to marker when should render avatar marker const markerRoomMember = isSelfLocation(mxEvent.getContent()) ? mxEvent.sender : undefined; const geoUri = locationEventGeoUri(mxEvent); @@ -150,7 +153,7 @@ export const LocationBodyContent: React.FC = ({ return (
- +
{mapElement}