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

prevent bindings interfering with each other on the same element #503

Merged
merged 1 commit into from
Apr 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/generators/dom/visitors/Element/Binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function visitBinding ( generator, block, state, node, attribute

let setter = getSetter({ block, name, keypath, context: '_svelte', attribute, dependencies, value });
let updateElement = `${state.parentNode}.${attribute.name} = ${snippet};`;
const lock = block.getUniqueName( `${state.parentNode}_${attribute.name}_updating` );
const lock = block.alias( `${state.parentNode}_updating` );
let updateCondition = `!${lock}`;

// <select> special case
Expand Down Expand Up @@ -103,7 +103,7 @@ export default function visitBinding ( generator, block, state, node, attribute
const last = block.getUniqueName( `${state.parentNode}_paused_value` );
block.builders.create.addLine( `var ${last} = true;` );

updateCondition += ` && ${last} !== ( ${last} = ${snippet} )`;
updateCondition = `${last} !== ( ${last} = ${snippet} )`;
updateElement = `${state.parentNode}[ ${last} ? 'pause' : 'play' ]();`;
}
}
Expand Down