Page MenuHomePhabricator

TagItemWidget gets destroyed when enter is pressed on the link inside of it
Open, Needs TriagePublic

Description

If there's a category entered in the Pages in these categories: field and you tab on it:

  • the first tab selects the tag item ( a.k.a. pill field ),
  • second tab selects the link inside of the item.

If you then press enter, the expected behavior would be for the link to get opened in a new tab, instead the pill is destroyed.
Not sure how much of that is standard behavior, but at least opening the link should be somehow possible by keyboard only.
Please see the gif below:

category-pill.gif (834×1 px, 114 KB)

As far as I can tell, this is coming from an event handling logic defined in [[ https://doc.wikimedia.org/oojs-ui/master/js/source/TagItemWidget.html#OO-ui-TagItemWidget | TagItemWidget's constructor ]].
Please note this ticket is meant to start a discussion about how we want those fields to behave. Once that's decided we can discuss how (and where) to approach the implementation.

p.s. The behavior is the same for the template field. Both are using TagMultiselectWidget ( which inherits TagItemWidget ).

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Tonina_Zhelyazkova_WMDE renamed this task from TagItemWidget gets destroyed when enter is pressed on the link inside it to TagItemWidget gets destroyed when enter is pressed on the link inside of it.Jun 18 2018, 4:10 PM

@Tonina_Zhelyazkova_WMDE are TagMultiselectWidget and TagItemWidget from us or from OOUI? Do we know what standard OOUI behavior is for such a case, e.g. with the CategoryMultiSelectWidget?

@Lea_WMDE TagMultiselectWidget and TagItemWidget are OOUI widgets. CategoryMultiselectWidget is mediawiki widget, which uses CapsuleMultiselectWidget (OOUI), and we refactored that since CapsuleMultiselectWidget is deprecated. Nevertheless, the behavior in CategoryMultiselectWidget regarding pills is the same as described in this ticket - the pill gets destroyed when the link inside of it is selected (by tabbing) and enter is pressed (as seen in Upload Wizard).

I'm sorry if all this looks confusing. What I mean by this ticket is that the behavior right now does not allow keyboard users to open the link inside a pill. I'm not sure what the standard OOUI behavior is for such cases.

Vvjjkkii renamed this task from TagItemWidget gets destroyed when enter is pressed on the link inside of it to 2paaaaaaaa.Jul 1 2018, 1:03 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from 2paaaaaaaa to TagItemWidget gets destroyed when enter is pressed on the link inside of it.Jul 2 2018, 4:30 AM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

@Lea_WMDE I'd follow @Tonina_Zhelyazkova_WMDE task description here, especially as for pointer usage it already opens the category page. So keyboard enter when focussed on the link should result in the same. The UI functionality is complex, and I see a possible pitfall in users being accustomed to normal tag behaviour and not understanding that the tag is also a link.
In current visual representation this (and its focus state) is very subtle/suboptimal. If we stay with a link within the tag we should file a follow-up improving the link (focus) appearance.
Another idea that comes to my mind is to provide a Popup tooltip with the link when the tag is focussed, in a kind of separating functionality. We would then have to care about keyboard focus order though.