bug: Ion Input ClearInputIcon not working - Angular

Offen
#30,901 1 Kommentar 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
angular, typescript
Bereich
frontend

Rechercherichtung

Beginne mit der verlinkten StackBlitz-Reproduktion und der Angular-Verarbeitung von ion-input für clearInputIcon; vergleiche die Verwendung als einfaches Attribut mit Property Binding und dem bestehenden clearInput-Verhalten. Fertig ist die Aufgabe, wenn das benannte Icon gerendert wird, sobald clearInput aktiviert ist, ohne CUSTOM_ELEMENT_SCHEMA zu benötigen, und das Verhalten bei Bedarf dokumentiert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

triage
Prerequisites
Ionic Framework Version

v8.x

Current Behavior

When using ion-input there is a property clearInputIcon where we can put the name of an imported icon as a string, it should replace the icon for the clear option when clearInput property is set to true but I only get the default one

Expected Behavior

When using ion-input there is a property clearInputIcon where we can put the name of an imported icon as a string, it should replace the icon for the clear option when clearInput property is set to true.

Steps to Reproduce
  1. In HTML Set an ion-input
  2. Set property clearInput to true
  3. Set property clearInputIcon to an icon for example "analytics-outline"
  4. In TS/JS import analyticsOutline from ionicons with the addIcons method
  5. You will see that the icon does not change
Code Reproduction URL

https://stackblitz.com/edit/fhf2js9x

Ionic Info

/

Additional Information

I've tested multiple things and the only to make it work is to use the property with binding [] syntax
The problem is that clearInputIcon is not recognized and we need to use the CUSTOM_ELEMENT_SCHEMA which should not happen (since the other properties for example clearInput do not need them).

Without this the component does not seem to recognize and user the clearInputIcon property on the ion-input

Can you check and confirm please ? We should be able to use this property as the other one easily without this, moreover this is not specified in the documentation.

Vorherrschende Sprache
TypeScript
Sterne
52.8k
Forks
13.3k
Ø Merge
3 T. 1 Std.
Gemergte PRs (30 T.)
86

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ionic-team/ionic-framework

Alle Issues in ionic-team/ionic-framework

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.