Skip to content

Commit 8eea331

Browse files
committed
fix: hover scale conditional
avoids popover from shifting while open
1 parent 7c63636 commit 8eea331

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/components/FeedbackWidget/FixedDot.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import { Button } from "@/../tailwind/ui/buttons/Button"
1111
type FixedDotProps = ButtonHTMLAttributes<HTMLButtonElement> & {
1212
isExpanded: boolean
1313
offsetBottom?: boolean
14+
suppressScale?: boolean
1415
}
1516

1617
const FixedDot = forwardRef<HTMLButtonElement, FixedDotProps>(
17-
({ offsetBottom, isExpanded, className, ...props }, ref) => {
18+
({ offsetBottom, isExpanded, suppressScale, className, ...props }, ref) => {
1819
const { t } = useTranslation("common")
1920
return (
2021
<Button
@@ -23,7 +24,8 @@ const FixedDot = forwardRef<HTMLButtonElement, FixedDotProps>(
2324
aria-label={t("feedback-widget")}
2425
className={cn(
2526
"lg:mt-inherit sticky bottom-4 z-20 me-4 ms-auto flex size-12 items-center gap-0 rounded-full text-white shadow-table-item-box",
26-
"transition-all duration-200 hover:scale-110 hover:transition-transform hover:duration-200",
27+
"transition-all duration-200 hover:transition-transform hover:duration-200",
28+
!suppressScale && "hover:scale-110",
2729
offsetBottom && "bottom-31 lg:bottom-4",
2830
isExpanded ? "lg:w-60 lg:gap-3" : "lg:w-12",
2931
className

src/components/FeedbackWidget/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ const FeedbackWidget = () => {
3333
open={isOpen}
3434
>
3535
<PopoverTrigger asChild>
36-
<FixedDot offsetBottom={offsetBottom} isExpanded={isExpanded} />
36+
<FixedDot
37+
offsetBottom={offsetBottom}
38+
isExpanded={isExpanded}
39+
suppressScale={isOpen}
40+
/>
3741
</PopoverTrigger>
3842

3943
<PopoverContent className="mx-2 w-80 max-w-[calc(100vw_-_1rem)] rounded bg-background p-4 sm:p-8">

0 commit comments

Comments
 (0)