Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always starts with 4 tab indented lines when initialized with empty value #30

Open
tommyka opened this issue May 14, 2024 · 6 comments
Open
Assignees
Labels
question Further information is requested

Comments

@tommyka
Copy link

tommyka commented May 14, 2024

When i try to initialize the editor without any content/value as empty string it sets the value to \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t. It also fires a valueChanged event with that value.

If i give it a value like - than it only shows that.

@msoler8785
Copy link

I think I have a related issue, and maybe the cause of this issue. If I add custom toolbars like this:

<Toolbar>
    <MarkdownToolbarButton Action="MarkdownAction.Bold" Icon="fi fi-text-bold" Title="Bold" />
    <MarkdownToolbarButton Action="MarkdownAction.Italic" Icon="fi fi-text-italic" Title="Italic" />
    <MarkdownToolbarButton Action="MarkdownAction.Strikethrough" Icon="fi fi-text-strikethrough" Title="Strikethrough" />
    <MarkdownToolbarButton Action="MarkdownAction.Heading" Icon="fi fi-text-header-1" Title="Heading" />
</Toolbar

It initializes a line for each <MarkdownToolbarButton /> along with any whitespace in front of the line.

@msoler8785
Copy link

I wonder if it's because the toolbar is inside of the <textarea></textarea> tags:

<textarea @ref="@ElementRef" id="@ElementId">
@if (Toolbar != null)
{
@Toolbar
}
</textarea>

@erossini erossini self-assigned this Jun 2, 2024
@erossini erossini added the question Further information is requested label Jun 2, 2024
@erossini
Copy link
Owner

erossini commented Jun 2, 2024

I'll check this issue asap.
Enrico

@erossini
Copy link
Owner

erossini commented Jul 1, 2024

Today, I updated the full repository. There is a new EasyMDE managed by myself. There is a lot of fixes in this new version.

@msoler8785
Copy link

Thanks for updating, but it didn't address this issue.

@geloidA
Copy link

geloidA commented Dec 12, 2024

I faced the same problem. My solution was to wrap the toolbar's markup code in a hidden element.

<Toolbar>
    <div style="display: none;">
        ...
    </div>
</Toolbar>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants