Skip to content

lazy model modifier not working with defineModel #14044

@michaelcozzolino

Description

@michaelcozzolino

Vue version

3.x

Link to minimal reproduction

https://play.vuejs.org/#eNqFU01v1DAQ/SuDL2mlkj2UU8lWAlREkSgIkLj4kiazwcWxjT+WXYL/O2ObTbe03d7sec8zb2aeJ/bKmHodkJ2xxnVWGA8OfTAgWzUsOfOOs3OuxGi09TCBxRVEWFk9QkXPqhm6VCb4twJlX1DO6sVtLJXg7CVXnVbOw+gGWKZcR9U7lFLDN21l/6w6ngnbqzBeoy2sxnkr1AB/QOXo+VF1Wh1TtmZRNJNCungcjWw90g2g2RO0fj7qHmUt299b6omqcwaLTINGJN7jFMr7QKaiIxH/CX004SHmtc2HcQsjOtcOeAbTlIcT4x5YUhRsN5cYU/d7HbMT2hUNbyWG+sZpRQud0nvOOj0aIdF+NF7QcDmjTLk+YS0N/9f7HPM24Mku3n3H7scD8Ru3STHOPll0aNe01BnzrR3QF/jiyxVu6DyDNIwgiX0A/IxOy5A0FtrroHqSvcfLai+z38gOX93FxqNyu6aS0MSMmc8ZWe7NgdZv5Z7WL/I7riJN8a5pn/gXAMWvZedL6HElFH5Im79v2vR7fgZhsS9iIT7l4V6si1X+cxUJyPfZS82iUO9aIv4F+SVO/g==

Steps to reproduce

In the given playground we have an InputField.vue that uses defineModel to manipulate the value in a native input field, if you use the number or trim modifier on it the conversion works out of the box, but if you use the lazy modifier it does not. I suppose this inconsistency is a bug or it should be documented

What is expected?

The lazy modifier should work out of the box.

What is actually happening?

The lazy modifier does not work, while trim or number work.

System Info

System:
    OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 10.31 GB / 31.05 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 22.14.0 - /home/michael/.nvm/versions/node/v22.14.0/bin/node
    Yarn: 4.7.0 - /home/michael/.yarn/bin/yarn
    npm: 10.9.2 - /home/michael/.nvm/versions/node/v22.14.0/bin/npm
    pnpm: 9.14.4 - /home/michael/.local/share/pnpm/pnpm
  Browsers:
    Chrome: 134.0.6998.35
    Firefox: 144.0.2
    Firefox Developer Edition: 144.0.2

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions