From bd7bd8e9b711c846e2f93bdb4e2ad9d4644cd465 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Fri, 12 Apr 2024 16:37:53 +0530 Subject: [PATCH] Fixed: the click issue in ion-select when used inside ion-chip(#167) As the ion-chip and ion-select has some padding between them when using ion-select inside ion-chip, if the user clicks outside of ion-select, but inside ion-chip in the padding part, the ion-select popover does not opens up. Added support to override the ion-select click event and added a click event on ion-chip to programatically trigger the ion-select event when user performs a click action anywhere inside ion-chip --- src/views/BrokeringQuery.vue | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index a14020c..998ab65 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -146,8 +146,8 @@ {{ translate("Proximity") }} - - + + {{ translate("kms") }} {{ translate("miles") }} @@ -156,8 +156,9 @@ {{ translate("Brokering safety stock") }} - - + + + {{ translate("greater than or equal to") }} {{ translate("greater") }} @@ -304,6 +305,9 @@ let hasUnsavedChanges = ref(false) let isRuleNameUpdating = ref(false) let routingStatus = ref("") +const operatorRef = ref() +const measurementRef = ref() + onIonViewWillEnter(async () => { emitter.emit("presentLoader", { message: "Fetching filters and inventory rules", backdropDismiss: false }) await Promise.all([store.dispatch("orderRouting/fetchCurrentOrderRouting", props.orderRoutingId), store.dispatch("util/fetchFacilities"), store.dispatch("util/fetchEnums", { enumTypeId: "ORDER_SALES_CHANNEL" }), store.dispatch("util/fetchShippingMethods"), store.dispatch("util/fetchFacilityGroups")]) @@ -363,6 +367,16 @@ onBeforeRouteLeave(async (to) => { return; }) +/* +When using ion-select inside ion-chip, if the user clicks on ion-chip and not on ion-select, the select popover does not open. +This happens because ionic does not provide any events for ion-chip OOTB. + +Defined ref for specific select those are inside ion-chip and on clicking the chip, explicitely calling the click event of ion-select that triggers the select options to be displayed +*/ +async function chipClickEvent(ref: any) { + ref.$el.click(); +} + function getRouteIndex() { // Filtering archived routes as the index and total count needs to calculated by excluding the archived routes const activeAndDraftRoute = currentRoutingGroup.value["routings"].filter((routing: any) => routing.statusId !== "ROUTING_ARCHIVED")