diff --git a/src/components/views/elements/AccessibleButton.tsx b/src/components/views/elements/AccessibleButton.tsx index 26b4390e56..05b844284a 100644 --- a/src/components/views/elements/AccessibleButton.tsx +++ b/src/components/views/elements/AccessibleButton.tsx @@ -14,7 +14,7 @@ limitations under the License. */ -import React, { forwardRef, FunctionComponent, HTMLAttributes, InputHTMLAttributes, Ref } from "react"; +import React, { ComponentProps, forwardRef, FunctionComponent, HTMLAttributes, InputHTMLAttributes, Ref } from "react"; import classnames from "classnames"; import { Tooltip } from "@vector-im/compound-web"; @@ -61,6 +61,8 @@ type DynamicElementProps = Partial< > & Omit, "onClick">; +type TooltipProps = ComponentProps; + /** * Type of props accepted by {@link AccessibleButton}. * @@ -96,6 +98,14 @@ type Props = DynamicHtmlElementProps & * Only valid when used in conjunction with `title`. */ caption?: string; + /** + * The placement of the tooltip. + */ + placement?: TooltipProps["placement"]; + /** + * Callback for when the tooltip is opened or closed. + */ + onTooltipOpenChange?: TooltipProps["onOpenChange"]; }; /** @@ -128,6 +138,8 @@ const AccessibleButton = forwardRef(function , ref: Ref, @@ -199,7 +211,13 @@ const AccessibleButton = forwardRef(function + {button} ); diff --git a/test/components/views/settings/devices/__snapshots__/CurrentDeviceSection-test.tsx.snap b/test/components/views/settings/devices/__snapshots__/CurrentDeviceSection-test.tsx.snap index 2cd642eac9..bd3ec55ca6 100644 --- a/test/components/views/settings/devices/__snapshots__/CurrentDeviceSection-test.tsx.snap +++ b/test/components/views/settings/devices/__snapshots__/CurrentDeviceSection-test.tsx.snap @@ -135,26 +135,22 @@ exports[` handles when device is falsy 1`] = ` > Current session -