Skip to content

feat: standalone input component should support icons #26297

Closed

Description

@EinfachHans

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

Activity

  1. changed the title [-]feat: standalone form components should support icon's[/-] [+]feat: standalone form components should support icons[/+] on Nov 16, 2022
  2. changed the title [-]feat: standalone form components should support icons[/-] [+]feat: standalone input component should support icons[/+] on Nov 17, 2022
  3. added
    type: feature request
    package: core
    on Nov 17, 2022
  4. TiBz0u commented on Nov 18, 2022

    @TiBz0u

    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

  5. WolfWalter commented on Apr 17, 2023

    @WolfWalter
  6. WolfWalter commented on Apr 20, 2023

    @WolfWalter

    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.

  7. SvenBudak commented on Sep 1, 2023

    @SvenBudak

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

  8. chrisk8er commented on Oct 2, 2023

    @chrisk8er

    it is still in progress?

  9. added a commit that references this issue on Dec 1, 2023
    357b8b2
  10. averyrousseau commented on Dec 1, 2023

    @averyrousseau
    Contributor

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

  11. ionitron-bot commented on Dec 31, 2023

    @ionitron-bot

    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.

  12. locked and limited conversation to collaborators on Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: coretype: feature request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions