U4-7497 - Hitting RETURN/ENTER in a "Multiple Textbox" should add another

Created by Chriztian Steinmeier 04 Dec 2015, 00:34:07 Updated by Mads Rasmussen 18 Aug 2017, 09:35:57

Subtask of: U4-9609

When using the "Multiple Textbox" property editor, it would be very nice for editors if the RETURN (or ENTER) key triggered the "plus" button to add another textbox (if allowed as per the configured "max" setting).

Comments

Shannon Deminick 26 Jun 2017, 07:17:21

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/


Robert Copilau 05 Jul 2017, 10:59:42

https://github.com/umbraco/Umbraco-CMS/tree/temp-U4-7497


Robert Copilau 14 Jul 2017, 12:31:31

PR: https://github.com/umbraco/Umbraco-CMS/pull/2048


Mads Rasmussen 16 Aug 2017, 10:56:05

I have tested this and it works as described 👍 but I ran into a couple of issues I think we need to get fixed before we merge it in:

  • If you set a minimum number of fields the last field gets focused. When you create a new node we need to make sure the “Enter name” field stays focused.
  • If I hit enter on the plus icon, two fields are added.

I can see you have added a new directive to handle the focus event for the input fields. We already have a directive which does the same. It is called “focusWhen” and you should be able to use that instead.

Let me know if you need any help to get the last things fixed.


Robert Copilau 17 Aug 2017, 10:15:43

Done, thanks for your help @madsrasmussen :D. Pull-Request: https://github.com/umbraco/Umbraco-CMS/pull/2048


Mads Rasmussen 18 Aug 2017, 09:35:19

It looks good! I have added a few fixes after I got it tested some more. Some of the use cases needed a little bit of refinement. This is what I have tweaked:

  • If you add focus to the “plus”-icon and hit enter it now focusses the new field.
  • If you hit enter from a field between two other fields, it will add a new field underneath that field and add focus. The same will happen when you hit backspace.
  • before we removed the field on backspace when there was no value in it. I have changed this so it now requires an extra hit on backspace to remove the field. I got surprised when I wanted to change the first character but then the field disappeared.

All merged!


Priority: Normal

Type: Feature (request)

State: Fixed

Assignee:

Difficulty: Normal

Category: UI

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.6.5

Due in version: 7.6.6

Sprint: Sprint 65

Story Points:

Cycle: