Skip to content

Fix iframe size feedback loop on Linux/Windows#54

Merged
ochafik merged 1 commit intomodelcontextprotocol:mainfrom
jonathanhefner:fix-iframe-resize-feedback-loop
Dec 1, 2025
Merged

Fix iframe size feedback loop on Linux/Windows#54
ochafik merged 1 commit intomodelcontextprotocol:mainfrom
jonathanhefner:fix-iframe-resize-feedback-loop

Conversation

@jonathanhefner
Copy link
Member

Compensate for viewport scrollbar width in size change notifications. On Linux/Windows, scrollbars consume space from the content area, causing a feedback loop where the iframe progressively shrinks to zero.

  • Use window.innerWidth - clientWidth to detect scrollbar width
  • Use max of getBoundingClientRect (CSS transforms) and scroll dimensions (content overflow) to report accurate size

🤖 Generated with Claude Code

Compensate for viewport scrollbar width in size change notifications.
On Linux/Windows, scrollbars consume space from the content area, causing
a feedback loop where the iframe progressively shrinks to zero.

- Use window.innerWidth - clientWidth to detect scrollbar width
- Use max of getBoundingClientRect (CSS transforms) and scroll dimensions
  (content overflow) to report accurate size

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jonathanhefner jonathanhefner force-pushed the fix-iframe-resize-feedback-loop branch from d031221 to ecf3779 Compare December 1, 2025 17:39
Copy link
Contributor

@ochafik ochafik left a comment

Choose a reason for hiding this comment

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

Thanks Jonathan!

@ochafik ochafik merged commit 1cf95e5 into modelcontextprotocol:main Dec 1, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants