[SOLVED] Prevent popup proxy from closing when clicking outside
-
Hi I am using a calendar popup similar to the one shown here: https://quasar.dev/vue-components/date#With-QInput
but I also have an ok button that triggers a method, and I don’t want users to be able to click outside the calendar to be able to dismiss it. Is there a way to prevent popup proxy from recognizing a click outside and only have it respond to my ok or cancel buttons?
-
@ssuess use the
persistent
pass-through (QMenu/QDialog) property -
This post is deleted! -
tried this, did not work:
<q-popup-proxy persistent> <q-date minimal flat v-model="startdate" mask="YYYY/MM/DD" :options="drangeOptions"/> <div class="row items-center justify-end" style="margin-top:-20px;"> <q-btn label="Cancel" color="secondary" flat v-close-popup /> <q-btn label="OK" color="secondary" @click="setSlider(1)" flat v-close-popup /> </div> </q-popup-proxy>
-
@ssuess actually, provide a codepen. Tried it on a codepen and persistent works just fine.
-
Well shit, when I put my exact code fragment into a codepen, it works (to prevent closure when clicking outside the calendar). But in my app, it does NOT. Still trying to figure out why that would be the case…
-
@ssuess maybe youre version is not updated, not sure when the props was added, but yeah worth checking your current quasar version.
-
I finally got it working after completely blowing away the cache in my browser’s settings. Force reload was not working for some reason, even though usually a force reload (shift-reload) works when there is cached weirdness. Now it is finally working. Thanks for your help.