samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
185 stars 124 forks source link

Pressing return key when editing metadata should not duplicate or remove fields #102

Closed mjgiarlo closed 7 years ago

mjgiarlo commented 7 years ago

Issue by mephillips-durham Wednesday Apr 15, 2015 at 16:53 GMT Originally opened as https://github.com/projecthydra/sufia/issues/1040


If I edit a file in Sufia, the "Abstract or Summary" box is quite tall, which encourages people to enter potentially more than one paragraph. If I type some text in this box and press return then an extra instance of the abstract field appears below the one I am editing. My cursor remains in the one I was editing.

The same problem occurs for single-line edit boxes like Keyword.

I think that for text areas like Abstract I think that return should cause a new line to be started (if that's acceptable in the metadata model, which it may not be). For the other fields it might be OK to add a new instance of the field but only if the cursor is moved to the new instance.

mjgiarlo commented 7 years ago

Comment by mtribone Monday Apr 20, 2015 at 13:37 GMT


We're having a similar conversation about the enter key here:

https://github.com/projecthydra/hydra-editor/pull/84

mjgiarlo commented 7 years ago

Comment by mephillips-durham Monday Apr 20, 2015 at 13:54 GMT


I'd be happier for Enter to submit the form than for it to potentially delete the metadata I'm in the middle of typing. But with what looks like a multi-line textarea in the case of the Abstract, some people are bound to hit Enter to add a new line, whatever we might decide about whether new lines are appropriate in that field. Unless you muck around with it, textarea allows Enter for new lines by default, so that is what most people will expect to happen. Probably best go for the principle of least surprise.

mjgiarlo commented 7 years ago

Comment by jechols Tuesday Apr 21, 2015 at 16:52 GMT


The PR I submitted just removes the overriding of ENTER via JavaScript, and fixes some HTML tags to make the non-submit buttons conform to the spec. If a textarea exists, enter won't so much submit the form as simply returning to its default behavior.

mjgiarlo commented 7 years ago

Comment by mjgiarlo Tuesday Dec 15, 2015 at 18:26 GMT


Related to #939?

mjgiarlo commented 7 years ago

Comment by mtribone Tuesday Dec 15, 2015 at 18:41 GMT


@mjgiarlo Nope. Not related to #939

jcoyne commented 7 years ago

Unable to reproduce. It's likely been fixed (and was likely fixed in Sufia too)