Dynamically injecting content to MarkdownEditor fails

Hey All,

I have a wizard with 2 steps, the first step contains a select to choose a markdown template, the second step has the content injected to the markdown editor, allowing to user to make minor edits if necessary.

Running into issues attempting to push content to the Markdown component . This works fine the first time, but changing the selection and navigating back to the second step 2 things happen:

1) The content is not updated
2) Clicking into the Markdown Editor seems to inject "invisible" content and throws a JS error in markdown-editor.js
Uncaught TypeError: i is undefined


Actions\Action::make('updateBlogContent')
    ->steps([
      Step::make('markdown-template')
        ->schema([
            FormComponents\Select::make('template')
              ->options(fn () => MarkdownTemplate::all()->pluck('name', 'id')->toArray())
              ->required()
              ->live()
              ->afterStateUpdated(function ($state, Set $set) {
                  $template = MarkdownTemplate::find($state);
                  $set('content', $template->content);
              }),
            ]),
        Step::make('blog-content')
          ->schema([
            FormComponents\MarkdownEditor::make('content')
          ]),
      ]),


I have tried adding
->live()
to the MarkdownEditor, but no such luck.

Any help is appreciated!
Was this page helpful?