From 0bf8459969de3cc18ef9db44772b25d91c2a1065 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 23 Jun 2026 18:56:42 -0400 Subject: [PATCH] fix: transition -> animation (#12802) --- app/editor/components/FloatingToolbar.tsx | 30 ++++++++++++++--------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/app/editor/components/FloatingToolbar.tsx b/app/editor/components/FloatingToolbar.tsx index c64934da5f..40f6b265ec 100644 --- a/app/editor/components/FloatingToolbar.tsx +++ b/app/editor/components/FloatingToolbar.tsx @@ -2,7 +2,7 @@ import { NodeSelection } from "prosemirror-state"; import { selectedRect } from "prosemirror-tables"; import * as React from "react"; import { Portal as ReactPortal } from "react-portal"; -import styled, { css } from "styled-components"; +import styled, { css, keyframes } from "styled-components"; import { isCode } from "@shared/editor/lib/isCode"; import { findParentNode } from "@shared/editor/queries/findParentNode"; import { EditorStyleHelper } from "@shared/editor/styles/EditorStyleHelper"; @@ -397,6 +397,15 @@ const Background = styled.div<{ align: Props["align"] }>` `} `; +// pointer-events is a discrete property and cannot be transitioned, so a +// delayed animation is used to re-enable interaction once the open animation +// has finished +const enableInteraction = keyframes` + to { + pointer-events: auto; + } +`; + const Wrapper = styled.div` will-change: opacity, transform; position: absolute; @@ -426,17 +435,16 @@ const Wrapper = styled.div` ${({ active }) => active && - ` - transform: translateY(-6px) scale(1); - opacity: 1; + css` + transform: translateY(-6px) scale(1); + opacity: 1; - & button, - & a, - & input { - pointer-events: auto; - transition: pointer-events 0s 300ms; - } - `}; + & button, + & a, + & input { + animation: ${enableInteraction} 0s 300ms forwards; + } + `}; @media print { display: none;