From 07a6f034e0858f3651cb9673d9fea6896181a25d Mon Sep 17 00:00:00 2001 From: Dmytro Soldatov Date: Fri, 20 Oct 2023 21:21:17 +0300 Subject: [PATCH] Fix: Not full override of destroy method. #102 (#103) --- src/ScrollBox.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ScrollBox.ts b/src/ScrollBox.ts index efd180c4..79988d6d 100644 --- a/src/ScrollBox.ts +++ b/src/ScrollBox.ts @@ -1,5 +1,5 @@ import { ColorSource, Ticker, utils } from '@pixi/core'; -import { Container, DisplayObject } from '@pixi/display'; +import { Container, DisplayObject, IDestroyOptions } from '@pixi/display'; import { EventMode, FederatedPointerEvent } from '@pixi/events'; import { Graphics } from '@pixi/graphics'; import type { ListType } from './List'; @@ -674,15 +674,19 @@ export class ScrollBox extends Container } } - /** Destroys the component. */ - override destroy() + /** + * Destroys the component. + * @param {boolean | IDestroyOptions} [options] - Options parameter. + * A boolean will act as if all options have been set to that value + */ + override destroy(options?: IDestroyOptions | boolean) { this.ticker.remove(this.update, this); this.background.destroy(); this.list.destroy(); - super.destroy(); + super.destroy(options); } protected restoreItemsInteractivity()