Preact: Fix some team textbox bugs (#2426)

---------

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
This commit is contained in:
Daniel Chen 2025-05-17 13:12:24 -04:00 committed by GitHub
parent aeedbe34b9
commit 38534cfd52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);