Sarai-WMDE added a comment.

  > In T305359#7837689 <https://phabricator.wikimedia.org/T305359#7837689>, 
@Erdinc_Ciftci_WMDE wrote:
  >
  >> In 1, Enter shouldn't do anything because the user can go to the next area 
by just using the 'tab'.,
  >
  > I don't follow the logic there. The normal behaviour of enter in a form is 
to activate or accept the currently selected element (e.g. activate a button; 
accept the currently highlighted option for  a `<select>` or in the list of 
auto-complete suggestions for an `<input>` and close the dropdown; open and 
close date or colour selectors), or to submit the form. What does that have to 
do with moving to the next field?
  
  Hey @Nikki! Just to clarify: In his message, @Erdinc_Ciftci_WMDE is not 
contradicting the normal behavior of Enter in forms that you're so rightfully 
describing, neither is he stating that focus should move to the next 
interactive element if Enter is pressed. He's just referring to the fact that, 
when he tried to reproduce the first scenario (pressing Enter again once an 
option has been selected), his focus was moving to a new field for some reason, 
which of course shouldn't happen. I'm sorry about the misunderstanding.
  
  > When selecting an item as the value of a statement, the first enter selects 
a search result, the second submits the edit. If there's no results, the first 
enter can't select a search result, which means the state can't change, so then 
the second enter behaves the same as the first and still can't select a search 
result.
  
  That's exactly the behavior of lookups and other inputs on item pages, 
indeed. The behaviors that @Michael is referring to, though, have been observed 
in an app that's currently being developed using our in-house design system. 
The page mainly contains a form with 3/4 fields, and we were trying to stop the 
whole form from submitting itself when Enter is pressed to make a selection. 
Michael also noticed a couple of cases for which the behavior of enter wasn't 
defined, and that's what Erdi and myself tried to help out with:
  
  1. Pressing "Enter" after an option has been selected and the Lookup is still 
focused? > Here one would usually throw a submit event (I guess this is what 
happens on item pages), but since we're handling a whole form, we guessed that 
information should be preserved and stay visible on the UI, therefore the "do 
nothing" indication.
  
  2. Pressing "Enter" after typing something for which there is no option 
available ("no-results" message is shown)? > Same as above, and as you 
describe: since there are no results to be selected, Enter would do nothing. 
Here Erdi was also suggesting an improvement in the context of this WIP form: 
if users tab away from an active lookup (input that displays a menu) then the 
menu should close.

TASK DETAIL
  https://phabricator.wikimedia.org/T305359

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: ItamarWMDE, Sarai-WMDE
Cc: Lydia_Pintscher, Nikki, Erdinc_Ciftci_WMDE, Sarai-WMDE, Aklapper, Michael, 
Astuthiodit_1, STHart, karapayneWMDE, Invadibot, maantietaja, ItamarWMDE, 
Akuckartz, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, 
_jensen, rosalieper, Scott_WUaS, Volker_E, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org

Reply via email to