From 38534cfd522f1945abea9007cb31959078d07a1a Mon Sep 17 00:00:00 2001 From: Daniel Chen <108989218+Daniel1464@users.noreply.github.com> Date: Sat, 17 May 2025 13:12:24 -0400 Subject: [PATCH] Preact: Fix some team textbox bugs (#2426) --------- Co-authored-by: Guangcong Luo --- play.pokemonshowdown.com/src/battle-team-editor.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/play.pokemonshowdown.com/src/battle-team-editor.tsx b/play.pokemonshowdown.com/src/battle-team-editor.tsx index db8e0eac2..678df2811 100644 --- a/play.pokemonshowdown.com/src/battle-team-editor.tsx +++ b/play.pokemonshowdown.com/src/battle-team-editor.tsx @@ -1044,7 +1044,7 @@ class TeamTextbox extends preact.Component<{ editor: TeamEditorState, onChange?: this.forceUpdate(); }; engageFocus(focus?: this['innerFocus']) { - if (this.innerFocus) return; + if (this.innerFocus && !focus) return; const editor = this.editor; if (editor.readonly) return; @@ -1420,6 +1420,7 @@ class TeamTextbox extends preact.Component<{ editor: TeamEditorState, onChange?: {this.setInfo.map((info, i) => { if (!info.species) return null; const set = editor.sets[i]; + if (!set) return null; const prevOffset = i === 0 ? 8 : this.setInfo[i - 1].bottomY; const species = editor.dex.species.get(info.species); const num = Dex.getPokemonIconNum(species.id);