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

Change the default editor of Markdown Field to Multi-line #12318

Closed
MikeAlhayek opened this issue Sep 2, 2022 · 12 comments · Fixed by #16189
Closed

Change the default editor of Markdown Field to Multi-line #12318

MikeAlhayek opened this issue Sep 2, 2022 · 12 comments · Fixed by #16189

Comments

@MikeAlhayek
Copy link
Member

MikeAlhayek commented Sep 2, 2022

Describe the bug

In a markdown field, if a user hits "Enter" button on their keyboard, the form get submitted instead of adding a new line.

To Reproduce

Steps to reproduce the behavior:

  1. Created a content type
  2. add a Markdown field with standard editor
  3. Create a new content item of that content type
  4. focus the field input and click "enter"

Expected behavior

When "Enter" in clicked, I expect a new line to be inserted instead of form submitting.

@hishamco
Copy link
Member

hishamco commented Sep 3, 2022

Is the same thing happen in Html field?

@MikeAlhayek
Copy link
Member Author

I don't think so. At least I don't think I recall experiencing this issue outside a standard Markdown field.

@Skrypt
Copy link
Contributor

Skrypt commented Sep 5, 2022

This is something that generally we would think that it be part of the Markdown editor itself. Looks like it is a regression from previous versions else it would have been reported way before.

@sebastienros sebastienros added this to the 1.x milestone Sep 8, 2022
@MikeAlhayek
Copy link
Member Author

MikeAlhayek commented Sep 10, 2022

@Skrypt I have not had time to look into it. But it works fine when you use textarea. The issue is when using a standard input. Maybe it does not like the input type? Not sure. I'll try to look into it when I have time.

At the same time, why do we even use a text input for a markdown by default? How can that ever be useful? Maybe the standard markdown should be textarea? Is there a good reason why markdown would be used in a in standard text input?

@hishamco
Copy link
Member

AFAIK textarea support enter key while others triggers the default submit button on the page. So, using textarea should fix the issue

@MikeAlhayek
Copy link
Member Author

@hishamco changing it would fix the issue. But at the same time we have Textarea editor for Markdown. I don't know if there is a valid reason why the standard editor uses an text input.

@hishamco
Copy link
Member

Really I don't know!! I'm expecting using TextArea for such editors

@MikeAlhayek
Copy link
Member Author

Apparently it a standard html behavior that for some reason I never paid attention to it. Anytime you hit enter while typing in html input of a type text will submit the form. So I don't think this is an issue.

I don't know if text make sense for markdown, so I suggest we change it to textarea.

@hishamco
Copy link
Member

Anytime you hit enter while typing in html input of a type text will submit the form. So I don't think this is an issue.

That's what I refered too here

@agriffard agriffard changed the title Pressing "Enter" button while typing in a markdown input, the form submit is triggred Pressing "Enter" button while typing in a markdown input, the form submit is triggered Sep 13, 2022
@Piedone Piedone changed the title Pressing "Enter" button while typing in a markdown input, the form submit is triggered Change the default editor of Markdown Field to to Multi-line May 20, 2024
@Piedone
Copy link
Member

Piedone commented May 20, 2024

Would you use Multi-line or WYSIWYG as the default editor?

@MikeAlhayek
Copy link
Member Author

Yes using Multi-line or WYSIWYG works just fine. I think the problem here was that the Markdown part use textarea by default. I think it may not be a bad idea to use Multi-line "textarea" by default drop the support for a single-line. Single-line is not useful when writing markdown.

@Piedone
Copy link
Member

Piedone commented May 28, 2024

Let's do multi-line for the lack of dependencies, then.

MikeAlhayek added a commit that referenced this issue May 29, 2024
@agriffard agriffard changed the title Change the default editor of Markdown Field to to Multi-line Change the default editor of Markdown Field to Multi-line May 29, 2024
@MikeAlhayek MikeAlhayek modified the milestones: 2.x, 2.0 Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants