Skip to content

Height for Monaco has 'initial' value, it prevents auto height increas #2149

Open
@elijahmg

Description

@elijahmg

It's probably about documentation, not a real bug

I'm working on programming course for kids and sometimes I need empty monaco editor.

Describe the bug

When there is an empty monaco-run editor it has fixed height, so as soon as I start writing code, the code block only becomes scrollable, but height does not increase.

Minimal reproduction

Steps to reproduce the behavior:

  1. Create any empty monaco editor runnable
  2. Start typing code inside
  3. Height stays fixed

https://stackblitz.com/edit/github-lcavt9dr?file=slides.md

Environment

  • Slidev version: 51.5.0
  • Browser: Chrome Version 134.0.6998.166 (Official Build) (arm64)
  • OS: MacOS 15.4

** Fix

In slide height must be set to 'auto'.

js {monaco-run} {autorun: false, height: 'auto'}

This is not documented anywhere. I'm happy to do so.
Or maybe change is possible here

height: 'initial',

Change from 'initial' to 'auto'

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions