Android build v1.1.17
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useMemo, useState, type ReactNode } from 'react'
|
||||
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
||||
import { ControllerStylePreview } from '../../../components/ControllerIcons'
|
||||
import { useGameAction, useInput, type ControllerIconStyle } from '../../../input'
|
||||
import { getGameMode } from '../../../gameRepository'
|
||||
@@ -161,6 +161,14 @@ export function Iwt2ScreenShell({
|
||||
|
||||
export function Iwt2ActionList({ actions }: Iwt2ActionListProps) {
|
||||
const { selectedIndex, setSelectedIndex } = useIwt2ActionList(actions)
|
||||
const rowRefs = useRef<Array<HTMLButtonElement | null>>([])
|
||||
|
||||
useEffect(() => {
|
||||
rowRefs.current[selectedIndex]?.scrollIntoView({
|
||||
block: 'nearest',
|
||||
inline: 'nearest',
|
||||
})
|
||||
}, [selectedIndex])
|
||||
|
||||
return (
|
||||
<div className="iwt2-action-list">
|
||||
@@ -174,6 +182,9 @@ export function Iwt2ActionList({ actions }: Iwt2ActionListProps) {
|
||||
onPointerDown={() => {
|
||||
if (!action.disabled) setSelectedIndex(index)
|
||||
}}
|
||||
ref={(element) => {
|
||||
rowRefs.current[index] = element
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
|
||||
Reference in New Issue
Block a user