Navigation

    Quasar Framework

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

    Closing drawer panel and then open modal?

    Help
    3
    9
    1613
    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.
    • C
      conx last edited by

      In this moment i using that flow:

      openModal () {
            this.$refs.layout.toggleRight()
            setTimeout(() => this.$refs.objModal.openModal(), 1)
          }
      

      Is any “easier” way?

      1 Reply Last reply Reply Quote 0
      • S
        spectrolite last edited by spectrolite

        openModal () {
          this.$refs.layout.toggleRight()
          this.$nextTick(() => {
            this.$refs.objModal.openModal()
          })
        }
        

        …is probably cleaner, and I really can’t see any simpler way to express those intentions.

        1 Reply Last reply Reply Quote 0
        • C
          conx last edited by

          Hi,
          Thanks!

          1 Reply Last reply Reply Quote 0
          • C
            conx last edited by

            uhh, working only for the first time… Next cycle only drawer panel closing, but modal does not show…(setTimeout forking)

            1 Reply Last reply Reply Quote 0
            • S
              spectrolite last edited by spectrolite

              yup… sorry, there’s a mistake in the code
              try this instead

              openModal () {
                this.$refs.layout.toggleRight()
                this.$refs.objModal.open()
              }
              

              and if you really need nextTick (for questions of sizing, events, tag presence or whatever), just put it back in.

              1 Reply Last reply Reply Quote 0
              • S
                spectrolite last edited by

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • S
                  spectrolite last edited by

                  btw if your panel is closed, this will open it, and then open the modal.
                  if that’s not what you want, consider using hideRight() instead of toggleRight()

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

                    Also note that toggleRight() and hideRight() accept a callback that is called after drawer panel gets closed. You should use that instead of using setTimeout() or nextTick()

                    C 1 Reply Last reply Reply Quote 1
                    • C
                      conx @rstoenescu last edited by

                      @rstoenescu thanks - callback working fine 🙂

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