0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

use correct context for resize handler - fixes #1898

This commit is contained in:
Rich Harris 2018-12-23 15:54:38 -05:00
parent eefe120e70
commit 0b1d735e96

View File

@ -494,7 +494,7 @@ export default class ElementWrapper extends Wrapper {
block.addVariable(resize_listener);
block.builders.mount.addLine(
`${resize_listener} = @addResizeListener(${this.var}, ${callee});`
`${resize_listener} = @addResizeListener(${this.var}, ${callee}.bind(${this.var}));`
);
block.builders.destroy.addLine(