Fix TextInput erasing content after special characters#1058
Fix TextInput erasing content after special characters#1058jvictordev1 merged 2 commits intomainfrom
Conversation
- Removed .trim modifier from v-model in BaseInput.vue to prevent interference with IME and special character composition. - Fixed incorrect template ref assignment in TextInput.vue. - Updated defineExpose in TextInput.vue and TextArea.vue to correctly proxy reactive properties using computed. - Bumped version to 3.154.7. Co-authored-by: lucasn4s <17988272+lucasn4s@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Greptile OverviewGreptile SummaryEsta PR corrige um bug crítico onde caracteres especiais (acentos, cedilha) faziam com que todo o texto subsequente fosse apagado ao desfocar o campo Principais alterações:
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/components/BaseInput.vue | Removido modificador .trim do v-model para corrigir problemas com IME e caracteres especiais |
| src/components/TextInput.vue | Corrigida sobrescrita de ref de template e convertidas exposições para propriedades computadas reativas |
| src/components/TextArea.vue | Convertidas exposições para propriedades computadas para garantir reatividade adequada |
Sequence Diagram
sequenceDiagram
participant User
participant TextInput
participant BaseInput
participant vModel
participant IME as IME/Browser
User->>TextInput: Digite caractere especial (ã, ç)
TextInput->>BaseInput: Propaga entrada via v-model
BaseInput->>IME: Composição de caractere com IME
IME->>BaseInput: Atualiza internalValue (sem .trim)
BaseInput->>vModel: Sincroniza estado
User->>BaseInput: Desfoca campo (blur)
BaseInput->>TextInput: Emite evento blur
BaseInput->>vModel: Atualiza model.value com internalValue completo
Note over TextInput,BaseInput: Refs expostas via computed() mantêm reatividade
User->>TextInput: Chama método exposto (focus, blur, etc)
TextInput->>BaseInput: Delega via baseInputRef.value
BaseInput->>IME: Executa ação nativa
|
O problema ainda está acontecendo. Gravacao.de.tela.de.2026-02-12.16-46-46.webm |
Identifiquei que a remoção do |
- Removed .trim modifier from v-model in BaseInput.vue and BaseMobileInput.vue to prevent interference with IME composition. - Added manual synchronization of internalValue with native DOM value on blur in BaseInput and BaseMobileInput to ensure final characters are captured correctly. - Fixed reactivity in TextInput and TextArea by using computed properties for exposed refs and fixing incorrect template ref assignments. - Bumped version to 3.154.7. Co-authored-by: lucasn4s <17988272+lucasn4s@users.noreply.github.com>
This PR fixes an issue where typing special characters (like accents or cedillas) in the
TextInputcomponent would cause all subsequent text to be erased when the field lost focus.The root cause was the use of the
.trimmodifier onv-modelwithin the foundationalBaseInput.vuecomponent. In Vue 3,.trimcan conflict with IME (Input Method Editor) composition, especially in combination with masking directives. By removing.trim, we ensure that the internal state remains in sync with the browser's input buffer during complex character entry.Additionally, this PR fixes several architectural bugs:
TextInput.vue, a template ref was being manually overwritten, which is both invalid in Vue 3.5+ (readonly refs) and caused the loss of exposed methods after any input.TextInput.vueandTextArea.vue, thedefineExposewas passing non-reactive values (evaluated at setup). These have been converted tocomputedproperties to ensure proper proxying of internal component state (likeisFocused).Version bumped to 3.154.7.
Fixes #916
PR created automatically by Jules for task 17951081976727250024 started by @lucasn4s