From 125b8ba3df0821d28dce6fd1c189f5f08557988d Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:36:27 +0100 Subject: [PATCH] Fixed bug of overlapping labels in text filters --- src/ui/pokedex-scan-ui-handler.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ui/pokedex-scan-ui-handler.ts b/src/ui/pokedex-scan-ui-handler.ts index c69d2e58076..524ab76bd83 100644 --- a/src/ui/pokedex-scan-ui-handler.ts +++ b/src/ui/pokedex-scan-ui-handler.ts @@ -103,7 +103,6 @@ export default class PokedexScanUiHandler extends FormModalUiHandler { // args[2] is an index of FilterTextRow - //TODO: This logic is probably way more complex than we need, and actually messes things up for moves and abilities with a space like "Leech Seed" show(args: any[]): boolean { this.row = args[2]; const ui = this.getUi(); @@ -179,4 +178,13 @@ export default class PokedexScanUiHandler extends FormModalUiHandler { } return false; } + + clear(): void { + super.clear(); + + // Clearing the labels so they don't appear again and overlap + this.formLabels.forEach(label => { + label.destroy(); + }); + } }