Skip to content

fix(CodeEditor): Adjust sizeToFit height bug#12529

Open
rebeccaalpert wants to merge 1 commit into
patternfly:mainfrom
rebeccaalpert:code-editor
Open

fix(CodeEditor): Adjust sizeToFit height bug#12529
rebeccaalpert wants to merge 1 commit into
patternfly:mainfrom
rebeccaalpert:code-editor

Conversation

@rebeccaalpert

@rebeccaalpert rebeccaalpert commented Jun 26, 2026

Copy link
Copy Markdown
Member

I think this addresses the issue?

What: Closes #12436

Additional issues:

Summary by CodeRabbit

  • Bug Fixes
    • Improved the editor’s auto-sizing behavior so it now updates height automatically as content changes when set to fit content.
    • This prevents the editor from staying at an outdated height after text is added or removed.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e933fa74-dd9b-4e59-b461-bec4131822a4

📥 Commits

Reviewing files that changed from the base of the PR and between 8edf04a and e7457bb.

📒 Files selected for processing (1)
  • packages/react-code-editor/src/components/CodeEditor/CodeEditor.tsx

Walkthrough

CodeEditor now subscribes to Monaco content-size changes in the sizeToFit path and recalculates editor height whenever content size changes.

Changes

CodeEditor sizeToFit content updates

Layer / File(s) Summary
React to Monaco size changes
packages/react-code-editor/src/components/CodeEditor/CodeEditor.tsx
The sizeToFit branch subscribes to Monaco onDidContentSizeChange and calls setHeightToFitContent() on each content-size update.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the CodeEditor sizeToFit height fix and matches the main change.
Linked Issues check ✅ Passed The change addresses #12436 by updating sizeToFit to react to content size changes and keep the editor growing.
Out of Scope Changes check ✅ Passed The diff is narrowly scoped to the sizeToFit height behavior in CodeEditor and adds no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@patternfly-build

patternfly-build commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

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.

Bug - CodeEditor - sizeToFit behavior is not working

2 participants