ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Feature Request: Helper/Hint text for inputs

Open ryanyakich opened this issue 10 years ago • 38 comments

Short description of the problem:

No easy way to add "helper" or "hint" text to a ion-input field.

What behavior are you expecting?

A way to add helper / hint text to an input field. As per Google's Specs:

Helper text, or hint text, should appear below the text field and either be persistently visible, or only visible on focus.

Maybe similar to ion-label's "inline / fixed / stacked / floating" having the ability for the message to be persistently visible, or only visible on focus. As well as accept color variables "danger" or "warning" could be useful for validation.

<ion-item>
  <ion-label>Password</ion-label>
  <ion-input type="password"></ion-input>
  <ion-helper-text >Your password isn’t strong enough, try making it longer.</ion-helper-text>
</ion-item>

Steps to reproduce: Not applicable

Other information:

http://www.google.com/design/spec/components/text-fields.html#text-fields-required-fields

Which Ionic Version? 1.x or 2.x 2.x (beta 7)

Run ionic info from terminal/cmd prompt: (paste output below)

Cordova CLI: 6.1.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.7
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: Not installed
ios-sim version: 4.1.1 
OS: Mac OS X El Capitan
Node Version: v6.2.1
Xcode version: Xcode 7.3.1 Build version 7D1014 

ryanyakich avatar Jun 06 '16 18:06 ryanyakich

This is a really interesting idea IMO.

danbucholtz avatar Jun 07 '16 05:06 danbucholtz

Here's a developed proposal:

<ion-item>
  <ion-label>Password</ion-label>
  <ion-input type="password"></ion-input>
  <ion-helper>We need a password in order to secure your account</ion-helper>
  <ion-helper focus>Please! At least 6 alphanumeric long</ion-helper>
  <ion-helper success positive>AWESOME! your password looks good!</ion-helper>
  <ion-helper error danger>Your password isn't strong enough, try making it longer.</ion-helper>
</ion-item>

the idea of ion-helper is to have a declarative way to insert help texts in inputs. ONLY one helper can be shown at a time.

<ion-helper>: by default, no success, neither error, or focused. could be used to explain why this is required. <ion-helper focus>: when the input is focused, you can use it to provide more detailed help <ion-helper success>: give the user a positive feedback! <ion-helper fail>: give the user a negative feedback, so they can fix it

@ryanyakich what do you think?

manucorporat avatar Jun 08 '16 13:06 manucorporat

@manucorporat That makes sense to me. I am not sure if maybe it would be better to have it more contained. Also, ion-helper seems a bit ambiguous, maybe ion-input-helper and ion-message inside?

<ion-item>
  <ion-label>Password</ion-label>
  <ion-input type="password"></ion-input>
  <ion-input-helper>
    <ion-message>Default helper text</ion-helper-text>
    <ion-message focus>Hey, I am focused</ion-helper-text>
    <ion-message success>Yay! it looks good!</ion-helper-text>
    <ion-message fail>Oh no! there is an error!</ion-helper-text>
  </ion-input-helper>
</ion-item>

Not sure if that makes sense.

ryanyakich avatar Jun 08 '16 13:06 ryanyakich

I like ion-message. What do other frameworks (and not just JS frameworks) call these elements?

/cc @brandyscarney

adamdbradley avatar Jun 09 '16 02:06 adamdbradley

Also, this should be purely CSS.

adamdbradley avatar Jun 09 '16 02:06 adamdbradley

Is there a workaround for this issue?

RG-AG avatar Sep 06 '16 09:09 RG-AG

I want this feature too, any progress on it?

theromis avatar Nov 29 '16 19:11 theromis

Will be nice to have this feature.

rpayanm avatar Jan 23 '17 22:01 rpayanm

Hello everyone! Thanks for the feature request. I'm going to move this issue over to our internal list of feature requests for evaluation. We are continually prioritizing all requests that we receive with outstanding issues. We are extremely grateful for your feedback, but it may not always be our next priority. I'll copy the issue back to this repository when we have begun implementation. Thanks!

jgw96 avatar Feb 06 '17 20:02 jgw96

This issue was moved to driftyco/ionic-feature-requests#43

jgw96 avatar Feb 06 '17 20:02 jgw96

Any update about this feature?

mnasyrov avatar Sep 01 '17 04:09 mnasyrov

+1

HudsonAfonso avatar Nov 14 '17 15:11 HudsonAfonso

+1

lewisflude avatar Dec 07 '17 13:12 lewisflude

+1

wormling avatar Dec 18 '17 08:12 wormling

+1

enricodeleo avatar Jan 13 '18 01:01 enricodeleo

+1

jbourjeli avatar Jan 19 '18 02:01 jbourjeli

+1

ghost avatar Feb 09 '18 19:02 ghost

+1

francovp avatar Feb 13 '18 21:02 francovp

+1

ghost avatar Feb 14 '18 18:02 ghost

+1

eltonmrk avatar Apr 27 '18 11:04 eltonmrk