maintain context for component events

pull/7738/head
Rich Harris 8 years ago
parent 14b0dc5274
commit 4ca1e4d62c

@ -339,6 +339,7 @@ export default class Component extends Node {
this.handlers.forEach(handler => { this.handlers.forEach(handler => {
handler.var = block.getUniqueName(`${this.var}_${handler.name}`); // TODO this is hacky handler.var = block.getUniqueName(`${this.var}_${handler.name}`); // TODO this is hacky
handler.render(compiler, block); handler.render(compiler, block);
if (handler.usesContext) block.maintainContext = true; // TODO is there a better place to put this?
}); });
if (this.name === 'svelte:component') { if (this.name === 'svelte:component') {

Loading…
Cancel
Save