Challenge for someone ... Ideas on alternatives to in focus / out focus / change for a text input field

Stacey Rogers shared this question 4 years ago

Im wondering if anyone has done anything like this or has any thoughts on how to do something .............

Im trying to replicate a text input with a global 'clear' option

So, Ive got a text input field

Before it's edited it says "Enter value"

(on focus in) When the user edits the field the first time the "Enter value" automatically clears down

(change) As soon as they start adding a value a new "clear" icon appears

(tap) If they hit the clear icon at any point it clears down the value they have entered

(on focus out) Once they move out of the field a value against a variable is set and the new value is shown instead of the "Enter value"

The clear button disappears

When they tap to edit again the old value is not auto-cleared but the clear icon appears ...

What I'm trying to replicate is explained in the diagram attached.

Ive tried this a number of ways but the problem I have is tapping the 'clear' button is effectively the same as losing focus on the text field and therefore tapping clear actually sets the value instead

Anyone any ideas on how to do this at all?


Comments (1)


This tutorial might be of some help here: