Page MenuHomePhabricator

ApiSandbox ignores last input unless it loses focus
Closed, ResolvedPublic

Description

Widgets such as the multi input widget convert the inputted text into a box upon losing focus or pressing enter, to allow multiple separate texts to be added. If text has been input but not converted when the widget's content is requested, the unconverted text is ignored. Because the make request button does not take focus when clicked (perhaps this is more a OOUI bug, then), the last input does not get converted, and thus gets ignored in the request. Clicking the button a second time, or pressing enter or clicking somewhere else before clicking the button will work as expected.

Steps to reproduce:

  1. Enter text into a field such as titles, but do not press enter or click enterwhere else
  2. Press make request. Note that the text is ignored
  3. Press make request again. Note that the text is now included

Details

Related Gerrit Patches:

Event Timeline

Majr created this task.Feb 25 2016, 7:02 AM
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 25 2016, 7:02 AM

What's happening here is that OO.ui.ButtonWidget doesn't take focus when clicked, so the OO.ui.CapsuleMultiSelectWidget isn't getting a 'blur' event until after the request is done and the "Results" tab is focused.

I'm not sure whether that represents a bug in ApiSandbox or in oojs-ui. The "don't take focus" thing is clearly intentional, but this sort of bug seems likely to recur in all sorts of places if oojs-ui doesn't at least document how to easily work around it. @matmarex, any thoughts on that?

Change 273243 had a related patch set uploaded (by Anomie):
ApiSandbox: Blur before sending request

https://gerrit.wikimedia.org/r/273243

Change 273243 merged by jenkins-bot:
ApiSandbox: Blur before sending request

https://gerrit.wikimedia.org/r/273243

Anomie closed this task as Resolved.Feb 26 2016, 6:25 PM
Anomie claimed this task.

The OOjs UI behavior changed per T76636, so that buttons now do take focus. The workaround can probably be reverted.

Volker_E removed a subscriber: gerritbot.