Skip to content

fix(embed): prevent inline embed layout shift on narrow viewports#28481

Open
mvanhorn wants to merge 1 commit intocalcom:mainfrom
mvanhorn:osc/fix-inline-embed-layout-shift
Open

fix(embed): prevent inline embed layout shift on narrow viewports#28481
mvanhorn wants to merge 1 commit intocalcom:mainfrom
mvanhorn:osc/fix-inline-embed-layout-shift

Conversation

@mvanhorn
Copy link

Summary

Fixes the layout shift that occurs on narrow viewports when switching between days in the inline embed. The shift is caused by a transient scrollbar appearing inside the iframe while the content height changes and before the parent can adjust the iframe height via __dimensionChanged.

  • Adds scrolling="no" attribute and overflow: hidden style to inline embed iframes
  • Inline embeds already manage height dynamically via __dimensionChanged events, so internal iframe scrolling is not needed
  • The parent .cal-inline-container already handles scrollbar hiding via CSS

Fixes #28475

Visual Demo

The fix prevents the brief scrollbar flash visible in this CodeSandbox linked from cal.com embed help docs when switching days on a narrow viewport.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  1. Open the inline embed CodeSandbox or set up a local inline embed
  2. Reduce the viewport width until the mobile layout is shown (time slots below the calendar)
  3. Switch between different days
  4. Before: The embed briefly shifts width as a scrollbar appears/disappears during height transitions
  5. After: The layout remains stable regardless of which day is selected

Test in both Chrome and Firefox, as the issue manifests slightly differently (Chrome shows a brief scrollbar flash, Firefox shows persistent scrollbar on some days).

Mandatory Tasks

  • I have self-reviewed the code
  • I have performed a self-QA

This contribution was developed with AI assistance (Claude Code).

Disable scrolling on inline embed iframes to prevent transient scrollbar
from causing width shifts when content height changes during day switches.
Inline embeds manage height dynamically via __dimensionChanged events, so
internal iframe scrolling is not needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CLAassistant
Copy link

CLAassistant commented Mar 18, 2026

CLA assistant check
All committers have signed the CLA.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Mar 18, 2026
@github-actions github-actions bot added the 🐛 bug Something isn't working label Mar 18, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copy link
Member

@sahitya-chandra sahitya-chandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a video demo?

@mvanhorn
Copy link
Author

cal-demo

gif attached, a little janky but gets the point across I think. lmk if works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline embed layout shifts on narrow viewports when switching selected days

3 participants