From 7d3725acb5192f11ae405b75c0fa4b51ed750cdc Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 01:20:40 +0100 Subject: [PATCH] Fixear persistencia de texto libre al salir del select --- .../example/components/ScoreboardPanel.vue | 51 +++++++++++-------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index 2dbb6da..76adba2 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -151,34 +151,12 @@ 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(); - } }); }; @@ -327,6 +305,35 @@ const saveRightSelectedPlayerChanges = () => { scoreboardStore.scoreboard.rightNameOverride = ''; }; + +watch( + leftInput, + (value) => { + if (!leftFocused.value) { + return; + } + + scoreboardStore.scoreboard.leftNameOverride = value; + if (value.trim()) { + startLeftCustomPlayer(); + } + }, +); + +watch( + rightInput, + (value) => { + if (!rightFocused.value) { + return; + } + + scoreboardStore.scoreboard.rightNameOverride = value; + if (value.trim()) { + startRightCustomPlayer(); + } + }, +); + watch( () => scoreboardStore.scoreboard.leftPlayerId, (playerId) => {