Auto-scroll party select list to keep selected Pokemon visible
This commit is contained in:
1 parent
48172bbc95
commit
c855778ea3
1 file changed
+3
@@ -733,6 +733,9 @@ class Game {
|
||||
const entries = document.querySelectorAll('.party-select-entry');
|
||||
entries.forEach((e, i) => {
|
||||
e.classList.toggle('party-selected', i === this._partySelectCursor && !e.classList.contains('fainted'));
|
||||
if (i === this._partySelectCursor) {
|
||||
e.scrollIntoView({ block:'nearest', behavior:'smooth' });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user