Joomla-cms: [4.0] Pressing 'Enter' in text input field works differently

Created on 27 Feb 2019  路  19Comments  路  Source: joomla/joomla-cms

Steps to reproduce the issue

  • Go to Article-New.
  • Fill the required title field.
  • Press 'Enter' in title field only or in other text field like tags, version note.

Expected result

It should do either of these (save , save & close , save & new).

Actual result

Usually pressing 'Enter' should do submit (here save/save & close/save & new) but here it close the new article without saving.

System information (as much as possible)

Joomla! 4.0.0-alpha7-dev
Google Chrome 72.0.3626.119

Additional comments

Similar thing happens in many text input field.

No Code Attached Yet

All 19 comments

issue confirmed

Confirmed. It is at least an unexpected behaviour without any kind of information.

Pressing the Enter / Space key in the text fields of the form should not trigger any action. Only in the case of the Enter / Space buttons should trigger an action consistent with the role of the button.
In the case of checklists, radio button, select list, the use of spaces selects / deselects option

@zwiastunsw Thats not correct. Think of the joomla admin login form.

Keyboard functionality and predictable consistent behavior are a condition of accessibility.
@brianteeman rightly points out that my brief & quick comment is not correct.

I should only write that the Expected result indicated in the issue description is not correct.

Generally, the Enter key is used to confirm the action. What are the standard default effects of pressing the Enter key?

  • Start a new paragraph in a text editor or word processor
  • Submit a simple form, e.g. search or login (so called implicit submission)
  • Activate a button
  • Execute the link
  • Performing a default action on the selected value (e.g. placing an accepted value to the list)
  • Expand or collapse the dropdown menu, collapsed panel.

Since the forms in Joomla backend are usually complex, assigning to the Enter key action such as "Save", "Save & Close", submit form (implicit submission), would cause a lot of confusion and disorientation, especially for blind users. That's why I wrote that "Pressing the Enter / Space key in the text fields of the form should not trigger any action."

A Space in a text field is a space.
We need a PR which implements "Pressing the Enter key in the text fields of a form should not trigger any action."


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24035.

More. We need to investigate whether there are other situations in which we have accidental results of using the Enter key. Of course, using the Enter key in the Search fields should start the search.

We need a PR which implements "Pressing the Enter key in the text fields of a form should not trigger any action."

Except it should in a search field and that it just a text field :(

Then it is better to make special fields where the enter key can trigger an action. For example in search.

Reading the following article its about how many fields are in the form

https://www.tjvantoll.com/2013/01/01/enter-should-submit-forms-stop-messing-with-that/

This is interesting.

But the issue here is an issue.
I fill a form and write a long text. Then I want to add a note - and in the note field I accidentally press enter. All input is los, I am back on the list view.
So how can @Harshil99 solve that?

Pressing the Enter key in the textarea field must start a new paragraph. Always.

@zwiastunsw I think we can't start paragraph in single line fields (i.e. Title field in new article).

@Harshil99: You think well, but I wrote about the textarea field, where we have many lines.

The issue here was the text field, for exaple the title field or the notes field

In the article of @brianteeman the user asks for submitting a form when the user presses enter.
I hate this - I use to accidentally submit posts which are not finished, just because I expect that the enter makes a new paragraph and does not send. But this is a personal experience.

In joomla edit forms:

Could we say that pressing enter in a text field may not leave the form without submitting the input?
If we say that the enter key submits the form, what is the default action? Save and Close?

There might be exceptions - the search form, the login form - or others. How can we define these exceptions?

Maybe this article will help you:
Implicit Submission of Form When Pressing Enter Key

I am not a programmer. In my opinion it is necessary to find an error. Implicit submission of a form with many fields, this is not the default, correct behavior.

Test PR #24123 please.

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/24035

closed as having Pull Request #24123

Was this page helpful?
0 / 5 - 0 ratings