pixi-viewport icon indicating copy to clipboard operation
pixi-viewport copied to clipboard

visible property in Container types is incorrect

Open mhazy opened this issue 4 years ago • 2 comments

Receiving the following error when using pixi-viewport with TypeScript 4.2.4 and Pixi 6.0.2

node_modules/pixi-viewport/index.d.ts(533,9): error TS2611: 'visible' is defined as a property in class 'Container', but is overridden here in 'Viewport' as an accessor.

Repro: https://github.com/mhazy/pixi-viewport-type-issue-repro

mhazy avatar May 07 '21 21:05 mhazy

Ugh. What a can of worms. The set visible() in pixi-viewport was used as a hack to ensure the input-manager clears its input states when viewport.visible = false. This fixed a specific bug but looking into how typescript compiles the code, I no longer think this works. I removed it in v4.31.0. If the issue comes up again, a developer can manually call viewport.input.clear() after setting the viewport.visible = false to clear the input state.

(Hopefully this entire issue becomes moot in pixi v7 when they implement a new input handler that should take away the need for pixi-viewport's complicated input-manager.)

davidfig avatar May 07 '21 23:05 davidfig

Thanks for the quick update, things are working as expected now

mhazy avatar May 18 '21 12:05 mhazy