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

fix: make sure model event in v-model is the first to avoid regression #6234

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Nov 19, 2024

☑️ Resolves

v-model event was fired later than the original like input or update:value. As a result - old event handlers were executed before the model value is actually updated

Solution: trigger the event defined in the model option first. Also, update:modelValue should be before update:model-value, but it was correct

To test: log model value from value update event from any component with v-model

<NcSelect
  v-model="value"
  @input="log('input', value)"
  @update:model-value="log('model-value', value)"
  @update:modelValue="log('modelValue', value)"
/>

<NcInputField
  v-model="value"
  @update:value="log('value', value)"
  @update:model-value="log('model-value', value)"
  @update:modelValue="log('modelValue', value)"
/>

🖼️ Screenshots

🏚️ Before 🏡 After
image image
image image

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 3️⃣ Backport to next requested with a Vue 3 upgrade

Otherwise `v-model` may update value later than it is used in input/update event handlers.

Signed-off-by: Grigorii K. Shartsev <[email protected]>
@ShGKme ShGKme added bug Something isn't working 3. to review Waiting for reviews regression Regression of a previous working feature labels Nov 19, 2024
@ShGKme ShGKme added this to the 8.20.1 milestone Nov 19, 2024
@ShGKme ShGKme requested review from susnux and Antreesy November 19, 2024 10:02
@ShGKme ShGKme self-assigned this Nov 19, 2024
@susnux susnux merged commit 6850be8 into master Nov 19, 2024
19 checks passed
@susnux susnux deleted the fix/v-model-priority branch November 19, 2024 12:11
@Antreesy Antreesy mentioned this pull request Nov 21, 2024
@Antreesy Antreesy modified the milestones: 8.20.1, 8.21.0 Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working regression Regression of a previous working feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Changing TaskProcessing selects wrong provider
3 participants