diff --git a/src/button/Button.tsx b/src/button/Button.tsx index bc6359d..c29b5f2 100644 --- a/src/button/Button.tsx +++ b/src/button/Button.tsx @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import React, { forwardRef } from "react"; +import React, { forwardRef, useCallback } from "react"; import { PressEvent } from "@react-types/shared"; import classNames from "classnames"; import { useButton } from "@react-aria/button"; @@ -273,8 +273,12 @@ export function FullscreenButton({ fullscreen, ...rest }: FullscreenButtonProps) { + const getTooltip = useCallback(() => { + return fullscreen ? "Exit full screen" : "Full screen"; + }, [fullscreen]); + return ( - "Full screen"}> + diff --git a/src/video-grid/VideoTileContainer.jsx b/src/video-grid/VideoTileContainer.jsx index 22338e7..55de199 100644 --- a/src/video-grid/VideoTileContainer.jsx +++ b/src/video-grid/VideoTileContainer.jsx @@ -22,6 +22,7 @@ import { useRoomMemberName } from "./useRoomMemberName"; import { VideoTile } from "./VideoTile"; import { VideoTileSettingsModal } from "./VideoTileSettingsModal"; import { useModalTriggerState } from "../Modal"; +import { useCallback } from "react"; export function VideoTileContainer({ item, @@ -65,6 +66,10 @@ export function VideoTileContainer({ videoTileSettingsModalState.open(); }; + const onFullscreenCallback = useCallback(() => { + onFullscreen(item); + }, [onFullscreen, item]); + // Firefox doesn't respect the disablePictureInPicture attribute // https://bugzilla.mozilla.org/show_bug.cgi?id=1611831 @@ -85,7 +90,7 @@ export function VideoTileContainer({ onOptionsPress={onOptionsPress} localVolume={localVolume} isFullscreen={isFullscreen} - onFullscreen={() => onFullscreen(item)} + onFullscreen={onFullscreenCallback} {...rest} /> {videoTileSettingsModalState.isOpen && (