From d5b08ef4ee87b0589414bed98b5cd4bae84a39b9 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 01:29:32 +0100 Subject: [PATCH] =?UTF-8?q?Corregir=20override=20en=20escritura=20libre=20?= =?UTF-8?q?sin=20romper=20selecci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/components/ScoreboardPanel.vue | 61 ++++++------------- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index 3889a67..ffe0b1e 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -14,8 +14,6 @@ const leftInput = ref(''); const rightInput = ref(''); const leftFocused = ref(false); const rightFocused = ref(false); -const leftIgnoreInputSync = ref(false); -const rightIgnoreInputSync = ref(false); const leftCountryInput = ref(''); const rightCountryInput = ref(''); @@ -153,12 +151,32 @@ const startRightCustomPlayer = () => { const onLeftFilter = (val: string, update: (fn: () => void) => void) => { update(() => { leftFilter.value = val; + + if (!leftFocused.value) { + return; + } + + leftInput.value = val; + scoreboardStore.scoreboard.leftNameOverride = val; + if (val.trim()) { + startLeftCustomPlayer(); + } }); }; const onRightFilter = (val: string, update: (fn: () => void) => void) => { update(() => { rightFilter.value = val; + + if (!rightFocused.value) { + return; + } + + rightInput.value = val; + scoreboardStore.scoreboard.rightNameOverride = val; + if (val.trim()) { + startRightCustomPlayer(); + } }); }; @@ -204,7 +222,6 @@ const onLeftSelect = (playerId: string) => { return; } - leftIgnoreInputSync.value = true; leftFocused.value = false; scoreboardStore.scoreboard.leftNameOverride = ''; leftFilter.value = ''; @@ -218,7 +235,6 @@ const onRightSelect = (playerId: string) => { return; } - rightIgnoreInputSync.value = true; rightFocused.value = false; scoreboardStore.scoreboard.rightNameOverride = ''; rightFilter.value = ''; @@ -312,43 +328,6 @@ const saveRightSelectedPlayerChanges = () => { }; -watch( - leftInput, - (value) => { - if (leftIgnoreInputSync.value) { - leftIgnoreInputSync.value = false; - return; - } - - if (!leftFocused.value) { - return; - } - - scoreboardStore.scoreboard.leftNameOverride = value; - if (value.trim()) { - startLeftCustomPlayer(); - } - }, -); - -watch( - rightInput, - (value) => { - if (rightIgnoreInputSync.value) { - rightIgnoreInputSync.value = false; - return; - } - - if (!rightFocused.value) { - return; - } - - scoreboardStore.scoreboard.rightNameOverride = value; - if (value.trim()) { - startRightCustomPlayer(); - } - }, -); watch( () => scoreboardStore.scoreboard.leftPlayerId,