Skip to content

CodeMirrorState not updated if not binding to (MarkdownStylesA)tSelectionsChanged #218

@davhdavh

Description

@davhdavh

It seems that the event handler for informing that there has been a change to state does not occur without a specific callback.

MarkdownStylesAtSelections is almost never updated:

   <CodeMirror6Wrapper Placeholder=""
                       @bind-Doc="@Model.Doc"
                       Language="@CodeMirrorLanguage.Markdown"
                       AutoFormatMarkdown="true"
                       Width="100%">
    <ContentBefore Context="c">
      @string.Join(",", c.State.MarkdownStylesAtSelections ?? [])
    </ContentBefore>
   </CodeMirror6Wrapper>

MarkdownStylesAtSelections is updated instantly:

   <CodeMirror6Wrapper Placeholder=""
                       @bind-Doc="@Model.Doc"
                       Language="@CodeMirrorLanguage.Markdown"
                       AutoFormatMarkdown="true"
                       MarkdownStylesAtSelectionsChanged="@(styles => {})"
                       Width="100%">
    <ContentBefore Context="c">
      @string.Join(",", c.State.MarkdownStylesAtSelections ?? [])
    </ContentBefore>
   </CodeMirror6Wrapper>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions