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

Bug with dynamic binding multiple for select tag. #4755

Closed
34x opened this issue Jan 19, 2017 · 1 comment · Fixed by #4756
Closed

Bug with dynamic binding multiple for select tag. #4755

34x opened this issue Jan 19, 2017 · 1 comment · Fixed by #4756
Labels

Comments

@34x
Copy link

34x commented Jan 19, 2017

Hello! First of all thank you for the great framework and your work.

I faced issue when tried to use select html tag with binded multiple attribute. But it does not work.
I have example on jsfiddle: https://jsfiddle.net/jqybwngo/

Partially copy bellow:

<div id="app">
  <select v-model="option" v-bind:multiple="isMultiple">
    <option value="1">item 1</option>
    <option value="2">item 2</option>
  </select>
</div>

And here is the error log from Safari (same for Firefox):
screen_2017_01_18_19_52_16

(found in root instance)
	warn (vue.js:525)
	setSelected (vue.js:5691)
	componentUpdated (vue.js:5672)
	callHook$1 (vue.js:4746)
	(anonymous function) (vue.js:4702)
	patchVnode (vue.js:4461)
	updateChildren (vue.js:4364)
	patchVnode (vue.js:4448)
	patch (vue.js:4572)
	_update (vue.js:2646)
	updateComponent (vue.js:2613)
	get (vue.js:2936)
	run (vue.js:3005)
	flushSchedulerQueue (vue.js:2811)
	(anonymous function) (vue.js:477)
	nextTickHandler (vue.js:426)
	promiseReactionJob
[Error] TypeError: binding.value.some is not a function. (In 'binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })', 'binding.value.some' is undefined)
componentUpdated — vue.js:5678
callHook$1 — vue.js:4746
https://unpkg.com/vue
patchVnode — vue.js:4461
updateChildren — vue.js:4364
patchVnode — vue.js:4448
patch — vue.js:4572
_update — vue.js:2646
updateComponent — vue.js:2613
get — vue.js:2936
run — vue.js:3005
flushSchedulerQueue — vue.js:2811
https://unpkg.com/vue
nextTickHandler — vue.js:426
promiseReactionJob

	logError (vue.js:439)
	promiseReactionJob

What is Expected?

Option is filled by array of selected values

What is actually happening?

Error reported in log, no parameter assigned.

@LinusBorg
Copy link
Member

Note: The example works if mutliple is not bound with v-bind: https://jsfiddle.net/Linusborg/jqybwngo/2/

yyx990803 pushed a commit that referenced this issue Jan 19, 2017
* support select multiple binding

* improve select onchange handle

* update  style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants