[fix] handle undefined select value with spread

pull/6687/head
shinyaigeek 5 years ago
parent 5df60e75a7
commit 7a61921eb9

@ -674,7 +674,7 @@ export default class ElementWrapper extends Wrapper {
(${data}.multiple ? @select_options : @select_option)(${this.var}, ${data}.value);
`);
block.chunks.update.push(b`
if (${block.renderer.dirty(Array.from(dependencies))}) (${data}.multiple ? @select_options : @select_option)(${this.var}, ${data}.value);;
if (${block.renderer.dirty(Array.from(dependencies))} && 'value' in ${data}) (${data}.multiple ? @select_options : @select_option)(${this.var}, ${data}.value);;
`);
} else if (this.node.name === 'input' && this.attributes.find(attr => attr.node.name === 'value')) {
const type = this.node.get_static_attribute_value('type');

Loading…
Cancel
Save