Fixear persistencia de texto libre al salir del select

This commit is contained in:
Pandipipas
2026-02-11 01:20:40 +01:00
parent 7e3f0853cd
commit 7d3725acb5
@@ -151,34 +151,12 @@ const startRightCustomPlayer = () => {
const onLeftFilter = (val: string, update: (fn: () => void) => void) => { const onLeftFilter = (val: string, update: (fn: () => void) => void) => {
update(() => { update(() => {
leftFilter.value = val; 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) => { const onRightFilter = (val: string, update: (fn: () => void) => void) => {
update(() => { update(() => {
rightFilter.value = val; 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 = ''; 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( watch(
() => scoreboardStore.scoreboard.leftPlayerId, () => scoreboardStore.scoreboard.leftPlayerId,
(playerId) => { (playerId) => {