From 8cade9ac7793ba44c43a05664a2dfe4ea4eb7fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 22 Aug 2025 23:09:38 +0200 Subject: [PATCH] [wip] Enhance AddressPicker to auto-select position when a single address with one position is found. --- .../Resources/public/vuejs/AddressPicker/AddressPicker.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/AddressPicker/AddressPicker.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/AddressPicker/AddressPicker.vue index b2c3465d5..2103f493d 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/AddressPicker/AddressPicker.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/AddressPicker/AddressPicker.vue @@ -63,6 +63,11 @@ const performSearchForAddress = async (search: string): Promise => { abortControllerSearchAddress, ); abortControllerSearchAddress = null; + + // check if there is only one result + if (addresses.value.length === 1 && Object.keys(addresses.value[0].positions).length === 1) { + onPickPosition(Object.keys(addresses.value[0].positions)[0]); + } } catch (e: unknown) { if (e instanceof DOMException && e.name === "AbortError") { console.log("search aborted for:", search);