pixijs / ui

Commonly used UI components for PixiJS

Home Page:https://pixijs.io/ui/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong behaviour in Button view setter.

slavatroitsky opened this issue · comments

Hey!
Please prove me wrong. If I set new view, I expect that events from old one will be disconnected. But in code I see that you are trying to disconnect events from new view I've just passed.
May be that should look like:
if (wasItInitiated) this.disconnectEvents(this._view);
Or
if (wasItInitiated) this.disconnectEvents(this.view);
Instead in code:
if (wasItInitiated) this.disconnectEvents(view);

https://github.com/pixijs/ui/blob/9de9052060bbe88cfa5b6bc5519701ac69814250/src/Button.ts#L53C43-L53C43