bug: ion-input doesn't support lazy modifier on v-model

Offen
#31,761 0 Kommentare 0 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
65/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
frontend

Rechercherichtung

Start by reading the Vue integration for ion-input and the component’s input and change event handling; the issue names no source files or tests. Compare the reproduced v-model.lazy behavior with a vanilla input and add coverage for when the bound ref updates. Done means the ref updates on blur for v-model.lazy while ordinary v-model behavior remains intact.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

triage
Prerequisites
Ionic Framework Version

v9.x

Current Behavior

Ion-input doesn't appear to support Vue's lazy modifier on v-model: https://vuejs.org/guide/essentials/forms.html#modifiers The associated ref still updates on every keystroke, rather than on the change event.

Expected Behavior

With v-model.lazy, the connected ref should only update when the input is blurred.

Steps to Reproduce
  1. Go to: https://stackblitz.com/edit/duayqrjj?file=src%2Fcomponents%2FExample.vue Note v-model.lazy on both inputs.
  2. Enter any text in the ion-input. Note that the item underneath updates on every keystroke.
  3. Enter any text in the vanilla input. Note that the item underneath only updates when the input is blurred.
Code Reproduction URL

https://stackblitz.com/edit/duayqrjj?file=src%2Fcomponents%2FExample.vue

Ionic Info

N/A (see stackblitz)

Additional Information

This can be worked around by keeping the ref in sync manually:

<ion-input :value="inputValue" @ionChange="e => inputValue = e.target.value"></ion-input>
Vorherrschende Sprache
TypeScript
Sterne
52.8k
Forks
13.3k
Ø Merge
3 T. 1 Std.
Gemergte PRs (30 T.)
78

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.