pixijs / ui

Commonly used UI components for PixiJS
https://pixijs.io/ui/
MIT License
187 stars 17 forks source link

bug: ScrollBox without background throws on destroy #176

Closed CatchABus closed 2 months ago

CatchABus commented 2 months ago

Expected Behavior

ScrollBox should be destroyed upon calling destroy without problems.

Current Behavior

ScrollBox throws upon destroy if background is not set and background should be optional

Steps to Reproduce

Call ScrollBox destroy().

Environment

CatchABus commented 2 months ago

The problem seems to be caused by ScrollBox being instantiated without options parameter: e.g.

const sb = new ScrollBox();
sb.addChild(new Graphics());

Perhaps, constructor options parameter should not be marked as optional or throw exception if developer doesn't call init.

CatchABus commented 2 months ago

Closing as it's not a bug.