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

feat: select, add errorText and helperText props

Open TheWieand opened this issue 1 year ago • 3 comments
trafficstars

Prerequisites

Describe the Feature Request

ion-select needs the errorText attribute to display e.g. if I want to make the selection mandatory.

Please add this or provide a proper workaround to display an error message below the ion-select

Describe the Use Case

When I use Angular FormControls, I can smoothly add errorText to Input etc. to display that something is wrong while validating the form.

Describe Preferred Solution

No response

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

TheWieand avatar Mar 23 '24 09:03 TheWieand

Thank you for submitting the feature request!

The team would like to move forward by adding an error text and helper text props to select. We were able to confirm that MD adds these through their documentation.

thetaPC avatar Apr 03 '24 17:04 thetaPC

Is this resolved until now? If not, how to cover errors?

crypt096 avatar Jun 14 '24 11:06 crypt096

Once the feature is added, we will update this issue to inform everyone. I recommend keeping an eye on it. In the meantime, you can use the ion-note component as a workaround to mimic the functionality of errorText and helperText:

<ion-select label="Default label" placeholder="Favorite Fruit">
  <ion-select-option value="apple">Apple</ion-select-option>
  <ion-select-option value="banana">Banana</ion-select-option>
  <ion-select-option value="orange">Orange</ion-select-option>
</ion-select>
<ion-note>Please select your favorite fruit</ion-note>

thetaPC avatar Jun 14 '24 15:06 thetaPC