diff --git a/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx b/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx index b83175ec8..e627a1d57 100644 --- a/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx +++ b/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx @@ -27,12 +27,15 @@ export function LaunchBarActionButton(props: Omit & { icon: string }) { + const { isHorizontalLayout } = useContext(LaunchBarContext); + return ( } + titlePosition={isHorizontalLayout ? "bottom" : "right"} {...props} >{children} ) diff --git a/apps/client/src/widgets/react/Dropdown.tsx b/apps/client/src/widgets/react/Dropdown.tsx index 2ba4900d7..bbf757a21 100644 --- a/apps/client/src/widgets/react/Dropdown.tsx +++ b/apps/client/src/widgets/react/Dropdown.tsx @@ -2,7 +2,7 @@ import { Dropdown as BootstrapDropdown } from "bootstrap"; import { ComponentChildren, HTMLAttributes } from "preact"; import { CSSProperties, HTMLProps } from "preact/compat"; import { MutableRef, useCallback, useEffect, useRef, useState } from "preact/hooks"; -import { useUniqueName } from "./hooks"; +import { useStaticTooltip, useUniqueName } from "./hooks"; type DataAttributes = { [key: `data-${string}`]: string | number | boolean | undefined; @@ -28,11 +28,16 @@ export interface DropdownProps extends Pick, "id" | "c onHidden?: () => void; dropdownOptions?: Partial; dropdownRef?: MutableRef; + titlePosition?: "top" | "right" | "bottom" | "left"; } -export default function Dropdown({ id, className, buttonClassName, isStatic, children, title, text, dropdownContainerStyle, dropdownContainerClassName, hideToggleArrow, iconAction, disabled, noSelectButtonStyle, noDropdownListStyle, forceShown, onShown: externalOnShown, onHidden: externalOnHidden, dropdownOptions, buttonProps, dropdownRef }: DropdownProps) { +export default function Dropdown({ id, className, buttonClassName, isStatic, children, title, text, dropdownContainerStyle, dropdownContainerClassName, hideToggleArrow, iconAction, disabled, noSelectButtonStyle, noDropdownListStyle, forceShown, onShown: externalOnShown, onHidden: externalOnHidden, dropdownOptions, buttonProps, dropdownRef, titlePosition }: DropdownProps) { const containerRef = useRef(null); const triggerRef = useRef(null); + useStaticTooltip(triggerRef, { + placement: titlePosition ?? "bottom", + fallbackPlacements: [ titlePosition ?? "bottom" ] + }); const [ shown, setShown ] = useState(false);