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

Form inputs in a repeating element not updating computed properties as expected when an array is mutated #65

Closed
daines opened this issue Feb 3, 2014 · 1 comment

Comments

@daines
Copy link

daines commented Feb 3, 2014

When using push to add objects to an array hooked up to a template element which contains form inputs, it appears that newly-created input elements are not bound in the same way as input elements created based on the initial data object provided when instantiating the Vue instance.

The newly-created input elements have the correct value after push is called, but typing in them doesn't cause a property computed on the array to change.

This commit has a functional test which demonstrates this:

daines@b5ec549

Strangely, this test passes when run with casper but fails in the browser. (I've tried Safari, Chrome, and Firefox.)

yyx990803 added a commit that referenced this issue Feb 3, 2014
A computed property can depend on properties on repeated items.
When new items are added to the Array, the dependency collection
has already been done so their properties are not collected by the
computed property on the parent. We need to re-parse the dependencies
in such situation, namely push, unshift, splice and when the entire
Array is swapped.

Also included casper test case by @daines.
@yyx990803
Copy link
Member

Thanks for reporting this! Fixed in a7dfb3f (see commit message for a detailed explanation)

The casper test case passes because you changed all three fields in the same event loop, so when the view is updated on next tick it's using the latest values. If you change the 3rd field alone the test will fail. I have modified your test case to account for this and included it in the commit.

connor4312 pushed a commit to connor4312/vue that referenced this issue Jan 23, 2020
* vuejs#65 - add sassOptions for docs

fix docs with error: 'options has an unknown property 'indentedSyntax'.'
which new sass-loader are writen in 'sassOptions';
This should also cause quick prototyping's sass setting, after executing '$vue serve'

* vuejs#65 - sassOptions fix for sass-loader

* vuejs#65 - fix sassOptions - lang:ru

* add comment for sassOptions version

* add comment for sassOptions

* add comment for sassOptions

* Update docs/guide/pre-processors.md

Co-Authored-By: Haoqun Jiang <[email protected]>

* Update pre-processors.md

* Update pre-processors.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants