abdelhamiderrahmouni / filament-monaco-editor

A Monaco Editor form field for FilamentPHP.
https://filamentphp.com/plugins/abdelhamid-errahmouni-monaco-editor
MIT License
11 stars 2 forks source link

[Bug]: Weird Rendering Issue. #12

Closed notAreYouScared closed 3 months ago

notAreYouScared commented 3 months ago

What happened?

When the page is first loaded and the state is formatted, the editor appears to be "small", and the right scroll bar extends past the viewable window. image

When "saving" the file, or doing an action on the page that updates the form, it then renders its full size. image

How to reproduce the bug

MonacoEditor::make('editor')
    ->label('')
    ->formatStateUsing(function () {
        /** @var Server $server */
        $server = Filament::getTenant();

        return app(DaemonFileRepository::class)
            ->setServer($server)
            ->getContent($this->path, config('panel.files.max_edit_size'));
    })
    ->language(fn (Get $get) => $get('lang') ?? 'plaintext'),

I guess if you just formatstatusing something that's, big? it should not render the full size.

Package Version

0.2.5

PHP Version

8.2

Laravel Version

11.10.0

Which operating systems does with happen with?

Windows

Notes

Would it be possible to get a variable to limit how many rows render on the page?

notAreYouScared commented 3 months ago
.fme-element{height:100%;max-height:90vh;min-height:80vh;width:100%;font-size:1.125rem;line-height:1.75rem}

Removing min-height:80vh fixed this issue. Also updated to 0.49.0 and all seems to work well.