Giter Club home page Giter Club logo

Comments (5)

alfonsobries avatar alfonsobries commented on July 17, 2024

MM not sure if that it's possible in that way but definitely a desired feature that Ill add to my to-do list

IN the meantime maybe you can add an observer to the show value to prevent to change (not tested)

watch: {
 show(show) {
  if (!show && *wantToPrevent*) {
    this.show = true
  }
}
}

from vue-tailwind.

maverick504 avatar maverick504 commented on July 17, 2024

Using a watcher doesn't worked, but i've made to get it work adding a logic to the before-close event handler that reopens the modal in a way the user doesn't notice.

It still isn't the best solution because the modal's DOM element gets removed and then created again in the next window frame. In my case i have a switch and a spinning animation on the submit button, and both of them gets reseted, which is not desired.

Anyway, this is the logic i'm using, i hope it to be helpful for somebody. ^_^

    beforeClose () {
      if(!wantToPrevent) return

      const scrollTopBefore = this.$refs.modal.$el.scrollTop

      this.$nextTick(() => {
        this.show = true

        this.$nextTick(() => {
          this.$refs.modal.$el.scrollTo(0, scrollTopBefore)
        })
      })
    }

from vue-tailwind.

ewerkema avatar ewerkema commented on July 17, 2024

Encountered the same problem as @maverick504, need to perform some checking before actually closing the modal. This functionality is already described in the docs: https://vue-tailwind.com/components/modal.html#events but it doesn't seem to be working in ^0.4.6

from vue-tailwind.

alfonsobries avatar alfonsobries commented on July 17, 2024

This should be fixed in this pr https://github.com/alfonsobries/vue-tailwind/pull/57/files that ill release tonight

from vue-tailwind.

alfonsobries avatar alfonsobries commented on July 17, 2024

upgrade to v1.1.5 that should solve the problem

from vue-tailwind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.