Convert onBlur handlers to arrow functions in App.tsx

This commit is contained in:
2026-04-02 20:20:18 +02:00
parent 9ee25f6db6
commit 81c934a93f

View File

@@ -4310,7 +4310,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
step="0.1" step="0.1"
value={pointLightIntensityDraft} value={pointLightIntensityDraft}
onChange={(event) => setPointLightIntensityDraft(event.currentTarget.value)} onChange={(event) => setPointLightIntensityDraft(event.currentTarget.value)}
onBlur={applyPointLightChange} onBlur={() => applyPointLightChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applyPointLightChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applyPointLightChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applyPointLightChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applyPointLightChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applyPointLightChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applyPointLightChange)}
@@ -4331,7 +4331,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
step="0.1" step="0.1"
value={pointLightDistanceDraft} value={pointLightDistanceDraft}
onChange={(event) => setPointLightDistanceDraft(event.currentTarget.value)} onChange={(event) => setPointLightDistanceDraft(event.currentTarget.value)}
onBlur={applyPointLightChange} onBlur={() => applyPointLightChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applyPointLightChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applyPointLightChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applyPointLightChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applyPointLightChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applyPointLightChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applyPointLightChange)}
@@ -4370,7 +4370,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
step="0.1" step="0.1"
value={spotLightIntensityDraft} value={spotLightIntensityDraft}
onChange={(event) => setSpotLightIntensityDraft(event.currentTarget.value)} onChange={(event) => setSpotLightIntensityDraft(event.currentTarget.value)}
onBlur={applySpotLightChange} onBlur={() => applySpotLightChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)}
@@ -4392,7 +4392,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
step="0.1" step="0.1"
value={spotLightDistanceDraft} value={spotLightDistanceDraft}
onChange={(event) => setSpotLightDistanceDraft(event.currentTarget.value)} onChange={(event) => setSpotLightDistanceDraft(event.currentTarget.value)}
onBlur={applySpotLightChange} onBlur={() => applySpotLightChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)}
@@ -4409,7 +4409,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
step="1" step="1"
value={spotLightAngleDraft} value={spotLightAngleDraft}
onChange={(event) => setSpotLightAngleDraft(event.currentTarget.value)} onChange={(event) => setSpotLightAngleDraft(event.currentTarget.value)}
onBlur={applySpotLightChange} onBlur={() => applySpotLightChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)}
@@ -4433,7 +4433,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
const nextValue = event.currentTarget.value; const nextValue = event.currentTarget.value;
setSpotLightDirectionDraft((draft) => ({ ...draft, x: nextValue })); setSpotLightDirectionDraft((draft) => ({ ...draft, x: nextValue }));
}} }}
onBlur={applySpotLightChange} onBlur={() => applySpotLightChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)}
@@ -4451,7 +4451,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
const nextValue = event.currentTarget.value; const nextValue = event.currentTarget.value;
setSpotLightDirectionDraft((draft) => ({ ...draft, y: nextValue })); setSpotLightDirectionDraft((draft) => ({ ...draft, y: nextValue }));
}} }}
onBlur={applySpotLightChange} onBlur={() => applySpotLightChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)}
@@ -4469,7 +4469,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
const nextValue = event.currentTarget.value; const nextValue = event.currentTarget.value;
setSpotLightDirectionDraft((draft) => ({ ...draft, z: nextValue })); setSpotLightDirectionDraft((draft) => ({ ...draft, z: nextValue }));
}} }}
onBlur={applySpotLightChange} onBlur={() => applySpotLightChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applySpotLightChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applySpotLightChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applySpotLightChange)}
@@ -4553,7 +4553,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
step="0.1" step="0.1"
value={soundEmitterVolumeDraft} value={soundEmitterVolumeDraft}
onChange={(event) => setSoundEmitterVolumeDraft(event.currentTarget.value)} onChange={(event) => setSoundEmitterVolumeDraft(event.currentTarget.value)}
onBlur={applySoundEmitterChange} onBlur={() => applySoundEmitterChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applySoundEmitterChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applySoundEmitterChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applySoundEmitterChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applySoundEmitterChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applySoundEmitterChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applySoundEmitterChange)}
@@ -4574,7 +4574,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
step="0.1" step="0.1"
value={soundEmitterRefDistanceDraft} value={soundEmitterRefDistanceDraft}
onChange={(event) => setSoundEmitterRefDistanceDraft(event.currentTarget.value)} onChange={(event) => setSoundEmitterRefDistanceDraft(event.currentTarget.value)}
onBlur={applySoundEmitterChange} onBlur={() => applySoundEmitterChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applySoundEmitterChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applySoundEmitterChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applySoundEmitterChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applySoundEmitterChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applySoundEmitterChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applySoundEmitterChange)}
@@ -4590,7 +4590,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
step="0.1" step="0.1"
value={soundEmitterMaxDistanceDraft} value={soundEmitterMaxDistanceDraft}
onChange={(event) => setSoundEmitterMaxDistanceDraft(event.currentTarget.value)} onChange={(event) => setSoundEmitterMaxDistanceDraft(event.currentTarget.value)}
onBlur={applySoundEmitterChange} onBlur={() => applySoundEmitterChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applySoundEmitterChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applySoundEmitterChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applySoundEmitterChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applySoundEmitterChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applySoundEmitterChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applySoundEmitterChange)}
@@ -4745,7 +4745,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
step="0.1" step="0.1"
value={interactableRadiusDraft} value={interactableRadiusDraft}
onChange={(event) => setInteractableRadiusDraft(event.currentTarget.value)} onChange={(event) => setInteractableRadiusDraft(event.currentTarget.value)}
onBlur={applyInteractableChange} onBlur={() => applyInteractableChange()}
onKeyDown={(event) => handleDraftVectorKeyDown(event, applyInteractableChange)} onKeyDown={(event) => handleDraftVectorKeyDown(event, applyInteractableChange)}
onKeyUp={(event) => handleNumberInputKeyUp(event, applyInteractableChange)} onKeyUp={(event) => handleNumberInputKeyUp(event, applyInteractableChange)}
onPointerUp={(event) => handleNumberInputPointerUp(event, applyInteractableChange)} onPointerUp={(event) => handleNumberInputPointerUp(event, applyInteractableChange)}
@@ -4778,7 +4778,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
type="text" type="text"
value={interactablePromptDraft} value={interactablePromptDraft}
onChange={(event) => setInteractablePromptDraft(event.currentTarget.value)} onChange={(event) => setInteractablePromptDraft(event.currentTarget.value)}
onBlur={applyInteractableChange} onBlur={() => applyInteractableChange()}
onKeyDown={(event) => { onKeyDown={(event) => {
if (event.key === "Enter") { if (event.key === "Enter") {
applyInteractableChange(); applyInteractableChange();