ISSUE DESCRIPTION defineModel on Firefox does not work as expected Vue version 3.5.17…
- User
ISSUE DESCRIPTION
defineModel on Firefox does not work as expected
Vue version
3.5.17
Link to minimal reproduction
Steps to reproduce
- Use firefox
- Enter anything in the field. It should be blocked and only show "a", but it wont on firefox.
What is expected?
It should only keep "a" and nothing else should "make it through"
What is actually happening?
Seems like either a race condition or firefox not updating at the same time as Chrome? no clue.
System Info
shellSystem: OS: Windows 11 10.0.26100 CPU: (20) x64 Intel(R) Core(TM) i5-14600K Memory: 12.60 GB / 31.77 GB Binaries: Node: 22.16.0 - C:\nvm4w\nodejs\node.EXE npm: 10.9.2 - C:\nvm4w\nodejs\npm.CMD Browsers: Edge: Chromium (134.0.3124.85) Internet Explorer: 11.0.26100.1882 -- Its not showing my actual browser: Firefox 139.0.4Any additional comments?
No response
Interface
No new interfaces are introduced.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use to restore the file to its original state. You can also reset all changes in the repository using command. Additionally, you can use and to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call ) using or commands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted.
- Assistant
I'll start by exploring the repository structure and understanding the
defineModelimplementation related to this Firefox issue. - Assistant
Let me decode the reproduction and find the relevant
defineModelcode. - Assistant
Python3 is not available. Let me try node instead.
- Assistant
Let me try different decompression methods. The play.vuejs.org uses lz-string or something similar.
- Assistant
Great, inflateSync worked. Let me get the full content.
- Assistant
This looks like a classic issue where setting the model to the same value doesn't update the DOM after user input. Let me dig into the v-model and defineModel implementation.
- Assistant
rg is not available, let me use grep.
- Assistant
Let me look at useModel which is the runtime implementation of defineModel.
- Assistant
Let me read the useModel.ts file and also look at v-model implementation for input elements.
- Assistant
Let me continue reading the file and also look at the vmodel implementation for form elements.
- Assistant
Let me open the vModel.ts file fully - this is where the DOM value assignment happens.
- Assistant
Let me read the beforeUpdate part more carefully.
- Assistant
Let me search for related issues in the changelog and codebase around Firefox and v-model.
- Assistant
Let me examine how event handlers interact and search for related bug reports or PRs.
- Assistant
Let me look at how Vue attaches event listeners relative to v-model directives.
- Assistant
Let me search for related GitHub issues and try to reproduce the bug with a test.
- Assistant
There's something interesting at line 385 of vModel.spec.ts. Let me read that test.
- Assistant
I think the bug is that when the filtered value equals the previous model value, no re-render is triggered. Let me inspect related history and tests.
- Assistant
There's a commit that may have introduced this bug. Let me inspect it.
- Assistant
That's just about checkboxes. Not the issue.
- Assistant
Let me look at the related useModel fixes more carefully.
- Assistant
Let me also look at the getter/setter change and existing tests more carefully.
- Assistant
I'll write a temporary test to reproduce the issue, then implement a fix.
- Assistant
I'll implement the fix and verify with a temporary test script.
- Assistant
I had a typo in the search string. Let me fix it.
- Assistant
The parent v-model checks are duplicated. Let me clean that up.
- Assistant
Let me carefully use the exact text from the file.
- Assistant
Now let me run the existing useModel tests and craft a temporary reproduction.
- Assistant
Let me run the useModel tests.
- Assistant
The test timed out. Let me try with vitest run directly.
- Assistant
All existing tests pass. Let me write a temporary script to reproduce the reported issue.
- Assistant
The test needs to be inside packages. Let me put it in the runtime-core tests folder temporarily.
- Assistant
Empty value serializes differently. Let me adjust the test to match existing patterns.
- Assistant
Looking at the existing #10279 test for the value format.
- Assistant
In the #10279 test, TAKT the setter itself handles the filtering on the same
childMsg.value = valuecall. In my test, I'm simulating: - Assistant
Strings get quotes. Let me fix encoding.
- Assistant
The replace failed because of the --all needed or I need to rewrite the file. Let me just rewrite it.
- Assistant
The issue is the uncached update handler. Let me fix the reproduction to match compiled SFC behavior.
- Assistant
I made a mess of the file with typos. Letme rewrite carefully.
- Assistant
Need to remove the file first.
- Assistant
Hmm the file only has 1 line? The create command might have had issues. Let me check.
- Assistant
The create during pipe might have issues. Let me use a different approach.
- Assistant
Good, now let's run the test.
- Assistant
The test passes with our fix. Let me verify it fails without our fix.
- Assistant
Confirmed: without the fix, the child doesn't re-render. Let me restore the fix.
- Assistant
Let me also verify with a realistic runtime-dom test using actual input elements.
- Assistant
runtime-dom tests use unit-jsdom project.
- Assistant
The DOM test passes. Let me verify it fails without the fix too.
- Assistant
Confirmed the root cause. Cleaning up temporary tests and reviewing the final fix.
- Assistant
Let me simplify slightly and run broader tests.
- Assistant
Let me run broader related tests to ensure nothing broke.
- Assistant
All tests pass. Verifying no temp files remain, then submitting.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.