Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: standalone input component should support icons #26297

Closed
3 tasks done
EinfachHans opened this issue Nov 16, 2022 · 7 comments
Closed
3 tasks done

feat: standalone input component should support icons #26297

EinfachHans opened this issue Nov 16, 2022 · 7 comments
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement

Comments

@EinfachHans
Copy link
Contributor

EinfachHans commented Nov 16, 2022

Prerequisites

Describe the Feature Request

This is a Feature Request to v7 and #26283

To fully be able to get rid of the deprecated usage of form elements within the ion item it would be great to support icon's within these elements as well.

Describe the Use Case

This are inputs in our current app:

D0BB0629-2C4C-4877-B78F-B8F23BF8D3D1

Many Password Input's have a toggle icon to show the password at the end. Also a start icon can be great to personalize the form element more.

Describe Preferred Solution

I would prefer a slot solution where deverlopers are able to place something at the start or end slot, similar to the item. With this it would be easier to add a click handler to the icon (to for example toggle the input mode to show or hide a password)

Also it should be somehow possible to not focus the element on icon click. If i think of the password toggle icon, a click on that icon should not focus the element.

Describe Alternatives

An alternative could be two properites startIcon and endIcon, but i don't really think this is the right way, as then there also should be two events for clicking these.

Related Code

No response

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Nov 16, 2022
@sean-perkins sean-perkins changed the title feat: standalone form components should support icon's feat: standalone form components should support icons Nov 16, 2022
@liamdebeasi liamdebeasi changed the title feat: standalone form components should support icons feat: standalone input component should support icons Nov 17, 2022
@liamdebeasi liamdebeasi added type: feature request a new feature, enhancement, or improvement package: core @ionic/core package labels Nov 17, 2022
@ionitron-bot ionitron-bot bot removed the triage label Nov 17, 2022
@TiBz0u
Copy link

TiBz0u commented Nov 18, 2022

Hey @EinfachHans , thanks for your this feature request.
For my information, how do you achieve this design currently?

I full agree with the necessity of icon event (ie: password reveal, tooltip, data masking, ...)

Regarding design of input with icon, it often refers to "inputGroup". Maybe it must be separated in a new component.
https://getbootstrap.com/docs/5.2/forms/input-group/
https://www.primefaces.org/primeng/inputgroup
https://www.primefaces.org/primeng/inputnumber

Another nice feature could be a picker in front of the input (ie: country selector for phone number).

Kr

@WolfWalter
Copy link

WolfWalter commented Apr 17, 2023

I was looking for the same thing for the password field. Is also part of the MD3 spec: https://m3.material.io/components/text-fields/guidelines#5c8a5f07-b1a5-455f-bf76-7ff0d724f6b0

@WolfWalter
Copy link

If this gets implemented, it would be great if it would also be possible to add multiple icons at the end. The use case for that is a password field with a show/hide button and a clear button.

@SvenBudak
Copy link

I was also very surprised today that there is no slot for buttons in inputs. Are there any updates on this?

@chrisk8er
Copy link

it is still in progress?

averyjohnston added a commit that referenced this issue Dec 1, 2023
Issue number: Resolves #26297

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

With the modern form control syntax, it is not possible to add icon
buttons or other decorators to the sides of `ion-input`, `ion-textarea`,
or `ion-select`, as you can with `ion-item`.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

`start` and `end` slots added to each component.

This PR is a combination of several others that were already approved.
If needed, it might be easiest to review the PRs individually by looking
at the commit history here.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Docs PR: ionic-team/ionic-docs#3271

Dev build: `7.5.4-dev.11701112913.1ea61220`

---------

Co-authored-by: ionitron <[email protected]>
Co-authored-by: Maria Hutt <[email protected]>
Co-authored-by: Liam DeBeasi <[email protected]>
@averyjohnston
Copy link
Contributor

This feature has been added via #28583 and will be available in a future minor release of Ionic. Thank you!

Copy link

ionitron-bot bot commented Dec 31, 2023

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement
Projects
None yet
Development

No branches or pull requests

7 participants