Page MenuHomePhabricator

TextInput endIcon and clearable are currently exchanging each other, not positioned side-by-side
Closed, ResolvedPublic

Description

Background/Goal

Code
In updated demos easily visible, TextInput endIcon and clearable are currently exchanging each other, not positioned side-by-side.
When clearable is enabled it is on top of endIcon. With current use of endIcon as required indicator, that would mean, the indicator wouldn't be visible any more.

Design
TextInput with endIcon and clearable variant is missing in our Figma library. We have the input with clearable icon (that it's named "With end icon") but we don't have a real end icon and clearable variant. We need to add both endIcon and endIcon clearable.

Captura de pantalla 2022-04-13 a las 15.27.18.png (702×2 px, 415 KB)

User stories

  • As a user I need the EndIcon visible when the Clear icon is displayed.
  • As a designer, I need to have the same TextInput variants from Codex available in the Figma library.

Acceptance criteria (or Done)

Design

Code

  • Position clearable before endIcon

Event Timeline

@AnneT I assign to me this task since I need to add the missing endIcon clearable variant in Figma. I will assign you the task again when I've finished the design part.

Also, I want to review how we want to work both end and clear icons because if we add them both in black and in the same size, it makes them compete and it's not well understood which is the decorative icon and which is the actionable one.

Captura de pantalla 2022-04-13 a las 15.33.20.png (534×1 px, 72 KB)

@bmartinezcalvo makes sense, thanks for handling this!

Hi all,

I've been working in two proposals to solve the end and clear icons position. First of all, in both proposals I've used subtle gray for Start and End (info) icons since they are decorative instead of actions so they shouldn't change the color on hover, active or filled states.

Option 1 (view prototype here to understand the states)

Option1-End and Clear.png (1×2 px, 114 KB)

  • Start and end icons with gray since they are decorative (subtle) and not interactive
  • EndIcon with 16px size (same as clear icon since they are in the same side)
  • Clear icon:
    • 16px
    • Interactive with hover and active states since it’s an action and not a decorative icon.
    • Placed before the end icon so the end icon is always in the same place and doesn’t move when the clear icon appears.
Option 2 (view prototype here)

At the moment, the only use cases I've found for TextInputs with EndIcon are the following:

  • Info icon: to provide more information about the input.
  • Asterisk icon: to inform the user about which input is required or not.

If we are using EndIcon only for this two use cases (info and asterisk) we could solve the problem with the following solution, moving the EndIcon next to the label instead of inside the TextInput. This solution will be more scalable with all our form fields (inputs, selects, etc.)

Option2 - Clear.png (1×2 px, 102 KB)


Requesting feedback from @iamjessklein for design and @Volker_E to know all real cases of text inputs with EndIcon.

@iamjessklein I assign you the task so you can to the Design Review and provide feedback in the task.

STH changed the task status from Open to In Progress.Apr 26 2022, 12:52 AM
STH triaged this task as Medium priority.

Removing the parent task so that this doesn't show up as a subtask of the TypeaheadSearch epic

Another thing to consider here: the required indicator (see T295167). What happens when a TextInput is required, has an end icon, and is clearable (or is this something that should never happen)?

Another thing to consider here: the required indicator (see T295167). What happens when a TextInput is required, has an end icon, and is clearable (or is this something that should never happen)?

@AnneT I delivered a proposal in this task T306427 to indicate only the optional fields instead of using the asterisk to indicate the required ones. See my last comment in T295167#7899115

@bmartinezcalvo to reach out to @iamjessklein for followup ; @Volker_E notes there is a technical issue with a visual overlap with asterisks, as well as with OOUI compatibility - good to consult with him as well for context

The smallest common denominator would be to fix that endIcon is not overlapping required icon. That should be a simple fix, to resolve UX confusion for the time being.
I see the general UI changes about required asterisk vs “(optional)” label treatment as absolutely valuable, but low priority from all topics that we're facing. And again, if we are only providing this in Codex that would result in users having to switch between form views facing two different form handling ways in a few clicks. Integrating it in OOUI on the other hand, would be a major undergoing which I don't see us taking on in reasonable future.

The smallest common denominator would be to fix that endIcon is not overlapping required icon. That should be a simple fix, to resolve UX confusion for the time being.
I see the general UI changes about required asterisk vs “(optional)” label treatment as absolutely valuable, but low priority from all topics that we're facing. And again, if we are only providing this in Codex that would result in users having to switch between form views facing two different form handling ways in a few clicks. Integrating it in OOUI on the other hand, would be a major undergoing which I don't see us taking on in reasonable future.

@Volker_E it makes sense, so I've created this other task T309594 (to evaluate if we want to update or no the EndIcon in TextInput component) so we can move forward with this task and update the Codex demo with the EndIcon visible when the clear one is displayed.


Updated TextInput component properties in our Codex library in Figma so EndIcon and Clear icon can be visible at the same time.

Captura de pantalla 2022-05-31 a las 12.01.55.png (634×1 px, 248 KB)

Captura de pantalla 2022-05-31 a las 12.01.20.png (730×2 px, 359 KB)

Change 802653 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[design/codex@main] TextInput: Allow clear and end icons to coexist

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

Change 802653 merged by jenkins-bot:

[design/codex@main] TextInput: Allow clear and end icons to coexist

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