### Description Expected: When adding a border to an image, I expect `Expand on Click` to animate smoothly. Actual: The animation appears broken. First mentioned in [this comment](https://github.com/WordPress/gutenberg/pull/63546#issuecomment-2228536818) related to adding margin support to the image. ### Step-by-step reproduction instructions 1. Add an image to a post 2. Give the image a border 3. Enable expand on click 4. Publish the post; click on the image and see that the animation is broken It looks like custom aspect ratios also affect the animation in different ways (see video below). ### Screenshots, screen recording, code snippet https://github.com/user-attachments/assets/07cae731-06d4-4978-9315-e2b2b27fcbca https://github.com/user-attachments/assets/24801e65-0d54-4d13-b891-3cdf128cc029 ### Environment info - WordPress 6.6-rc3 - Gutenberg 18.8.0-rc.1 ### Please confirm that you have searched existing issues in the repo. - [X] Yes ### Please confirm that you have tested with all plugins deactivated except Gutenberg. - [X] Yes
Description
Expected: When adding a border to an image, I expect
Expand on Clickto animate smoothly.Actual: The animation appears broken.
First mentioned in this comment related to adding margin support to the image.
Step-by-step reproduction instructions
It looks like custom aspect ratios also affect the animation in different ways (see video below).
Screenshots, screen recording, code snippet
lightbox-border-bug.mp4
lightbox-aspect-ratio-border.mp4
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.