Skip to content

Conversation

@hywax
Copy link
Member

@hywax hywax commented Nov 28, 2025

πŸ”— Linked issue

Resolves #5502

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@hywax hywax requested a review from benjamincanac as a code owner November 28, 2025 10:43
@github-actions github-actions bot added the v4 #4488 label Nov 28, 2025
@hywax hywax requested a review from sandros94 November 28, 2025 10:44
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 28, 2025

npm i https://pkg.pr.new/@nuxt/ui@5559

commit: 27e6a0a

…t with nullish coalescing assignment for modelModifiers handling
@sandros94
Copy link
Member

@hywax I'll review this in the weekend, as I'm not able to it atm. But I'm also interested in checking a strange edge case I've recently noticed on this topic

@sandros94
Copy link
Member

sandros94 commented Nov 30, 2025

Ok, my suspects were correct.

Both nullish coaleshing assignment (??=) and logical or assignment (||=) require additional information (coming from props.type) for the current component usage.

This also applies to other components like UInput. We might as well start to think about a unified internal utility for these modifiers

EDIT: to be more precise:

generally speaking an empty input model in vue it follows the initial state of its ref, but once edited (and manually deliting the content, using backspace in the input component) it make the ref an empty string. This would require ||=, but then it breaks if using number or checkbox, while ??= on the other hand would keep the empty string state ("").

This is something I'm still wrapping my head around, I've also documented it in the past in #3876 (comment) and #3876 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ModelModifiers for components

2 participants