Forum

Thread tagged as: Problem, Suggestions

Pressing return/enter on multiple item region adds another item

Pretty much what it says in the subject – when editing a multiple item region, pressing the Return/Enter key on the keyboard activates the Save & add another button rather than the Save changes button. This is with Perch 3.0.2.

Past versions of Perch (confirmed on 2.8.34) worked the other way 'round, which seems like the desired behaviour (especially for those used to Perch prior to V3).

Any chance we can see this behaviour changed?

Richard Terrick

Richard Terrick 3 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I can't reproduce that. What more can you tell me?

Sorry – I should have specified this happens when editing an item within a multiple item region. Here's a simple test:

  1. Create a multiple item region using a template with a single text field and go to the editing area for the first item
  2. Place your cursor in the text field and press Return/Enter
  3. The current region is saved, and another is spawned (i.e., as if you pressed Save and add another, so you now have your initial region and a new region)

The same steps pre-V3 would act as though you clicked Save changes.

Confirmed with Chrome Version 57.0.2987.133 (64-bit) and Safari 10.1 using Perch V3.0.2.

Let me know if this makes sense!

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's what I'm doing and I don't get another item.

Hey Drew – it looks like my tests weren't quite accurate, but I think I see what's happening: the "add another" behaviour occurs only when there's a perch:help block at the top of the template.

Give this template a try and see if you see the same behaviour:

<perch:help>
    <p>Any amount of HTML-formatted help can be specified here, including images and links if required.</p>
</perch:help>

<perch:content id="text" type="text" label="Text" />

Perhaps because the divider-collapse-zone div includes both the help text and an add_another button? (the one that visually appears in the upper-right of the editing view, not the submit-bar buttons)

Likely related: if you collapse the help text (via the down arrow icon next to the word "Help") the items div collapses with it.

Hopefully that's enough for you to see what's going on.

Drew McLellan

Drew McLellan 2638 points
Perch Support

We'll take a look.