No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    popup edit show/hide behaviour

    Framework
    2
    9
    879
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      amoss last edited by

      Hi

      I have a dialog with v-model that is set to false

      <q-dialog v-model="alert">
      

      When I want to show it, I set

      alert=true;
      

      and it shows.

      I want to do the same with popupedit

      <q-popup-edit v-model="showPopup" :cover="false" anchor="center middle">
      

      Clicking a button that sets showPopup to true does make it appear as expected.
      When clicking outside of it, it disappears as expected.
      The problem is when routing in/out from/to the page. When that happens, the popup appears for several seconds and then vanishes. Am I doing something wrong?
      Thanks

      1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman last edited by

        @amoss try to wrap your routing call in a nextTick.

        1 Reply Last reply Reply Quote 0
        • A
          amoss last edited by

          Just one more info that might be relevant: the popup edit is in app.vue so when I wrote route in/out, I actually meant routing between pages inside app.vue.

          1 Reply Last reply Reply Quote 0
          • metalsadman
            metalsadman last edited by

            @amoss well something might be changing your popup’s state or the component that holds it is rerendering, if the init state was true then that could be the reason why it’s poping in and out. probably make a minimal codepen that emulates the behavior.

            1 Reply Last reply Reply Quote 0
            • A
              amoss last edited by

              I think the problem is the fact it disappears when I click outside of it without actually setting showPopup = false; (hence it remains true).
              I guess my question would be: how to avoid closing the popup when clicking outside of it?
              Thanks

              ps: Did I understand correctly that not only the popup edit itself should v-model=“X” but also all its children components?

              1 Reply Last reply Reply Quote 0
              • metalsadman
                metalsadman last edited by metalsadman

                Just looked into the docs and see popup’s model isnt really for showing or hiding, so when you click outside it cancels the vmodel change and retain its state. There’s persistent prop. A codepen would help.

                1 Reply Last reply Reply Quote 0
                • A
                  amoss last edited by

                  You are right, so I’m even more confused now.
                  I tried v-if=“showPopup” but that doesn’t do anything when I set it to true.
                  persistent also made it go away when I clicked outside of it.

                  1 Reply Last reply Reply Quote 0
                  • A
                    amoss last edited by

                    I never used a codepen, I just tried now but it doesn’t seem to know “q-popup-edit” - it just shows the content of it…
                    Sorry for a newbie question

                    1 Reply Last reply Reply Quote 0
                    • A
                      amoss last edited by

                      I read some more and realized that popup edit is not what I need, but a dialog, Thanks!

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post