Skip to content

Commit

Permalink
Show toolbar tooltips on hover only, hide when dropdowns are open (#5109
Browse files Browse the repository at this point in the history
)

* Show toolbar tooltips on hover only, hide when dropdowns are open

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Re-run CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
franknoirot and github-actions[bot] authored Jan 18, 2025
1 parent df81b76 commit 9a537da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export function Toolbar({
<ToolbarItemTooltip
itemConfig={maybeIconConfig[0]}
configCallbackProps={configCallbackProps}
className="ui-open:!hidden"
/>
</ActionButtonDropdown>
)
Expand Down Expand Up @@ -277,9 +278,11 @@ export function Toolbar({
const ToolbarItemTooltip = memo(function ToolbarItemContents({
itemConfig,
configCallbackProps,
className,
}: {
itemConfig: ToolbarItemResolved
configCallbackProps: ToolbarItemCallbackProps
className?: string
}) {
const { state } = useModelingContext()

Expand All @@ -305,8 +308,9 @@ const ToolbarItemTooltip = memo(function ToolbarItemContents({
? ({ '-webkit-app-region': 'no-drag' } as React.CSSProperties)
: {}
}
hoverOnly
position="bottom"
wrapperClassName="!p-4 !pointer-events-auto"
wrapperClassName={'!p-4 !pointer-events-auto ' + className}
contentClassName="!text-left text-wrap !text-xs !p-0 !pb-2 flex gap-2 !max-w-none !w-72 flex-col items-stretch"
>
<div className="rounded-top flex items-center gap-2 pt-3 pb-2 px-2 bg-chalkboard-20/50 dark:bg-chalkboard-80/50">
Expand Down

0 comments on commit 9a537da

Please sign in to comment.