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

    [v1] $q.dialog() now returns a chainable object (with onOK/onCancel callbacks), not a promise. How to use promise with it?

    Framework
    4
    4
    1114
    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.
    • B
      beeplin last edited by

      Is there an option to let $q.dialog return a promise like it did in 0.17+ ? It is awkward to convert callbacks to promises and fit in the promise or async/await codes every time we use dialog.

      1 Reply Last reply Reply Quote 1
      • s.molinari
        s.molinari last edited by

        Can you explain your use case some to understand your need for asynchronous confirmation or cancellation of qdialog? And not even knowing your use case, could you build a custom dialog component for whatever async dialog needs you have?

        Scott

        1 Reply Last reply Reply Quote 0
        • rstoenescu
          rstoenescu Admin last edited by

          Something to get you started:

          return new Promise((resolve, reject) => {
           this.$q.dialog(...).onOk(resolve).onCancel(reject)
          }
          
          1 Reply Last reply Reply Quote 1
          • T
            turigeza last edited by

            I am just referencing this issue here because they are related. I also liked the promises. But apparently this is for performance reasons. See here:
            https://github.com/quasarframework/quasar/issues/4532#issuecomment-531502252

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