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

v-model modifiers can break emitting an update event if some parameter is not a string #5765

Closed
sqal opened this issue Apr 20, 2022 · 3 comments · Fixed by #5770
Closed

v-model modifiers can break emitting an update event if some parameter is not a string #5765

sqal opened this issue Apr 20, 2022 · 3 comments · Fixed by #5770
Labels
🐞 bug Something isn't working 🔩 p2-edge-case

Comments

@sqal
Copy link
Contributor

sqal commented Apr 20, 2022

Version

3.2.33

Reproduction link

sfc.vuejs.org

Steps to reproduce

  • Click ""update" button -> no error
  • Click "update with extra data" -> error a.trim is not a function

What is expected?

I would like to pass any type of value to update:xxx event

What is actually happening?

If v-model is used with built-in modifiers, e.g. trim or number then I cannot emit the update:xxx event if passed some parameter is not a string. Let's say i have custom Input component where I would like to pass additional data to update:modelValue event, e.g. an object with field name but currently, as shown in the demo, if I use trim modifiers, emitting such an event is not possible.

Looks like the issue is in these lines of code componentEmits.ts#L124

@sqal sqal changed the title v-model modifiers can break emitting an update event some parameter is not a string v-model modifiers can break emitting an update event if some parameter is not a string Apr 20, 2022
@LinusBorg LinusBorg added 🐞 bug Something isn't working 🔩 p2-edge-case labels Apr 20, 2022
@LinusBorg
Copy link
Member

Seems you spotted the right place. Up for a PR?

@shadowings-zy
Copy link
Contributor

Hi, I create a PR to fix this issue, see #5770.

@qxygene
Copy link

qxygene commented Apr 27, 2022

any update?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working 🔩 p2-edge-case
Projects
None yet
4 participants