We've moved discussions to Discord

closing dropdown in modal closes modal

Bob Walsh
I have a tailwindcss-stimulus-components dropdown in a modal. When I make a selection, the modal closes.

I created a custom stimulus controller cloning the code in the package. when I add a couple of alerts to it:

openValueChanged(event) {
    if (this.openValue) {
      this._show()
      alert("got openValueChanged-show")
    } else {
      alert("got openValueChanged-hide")
      this._hide()
    }

  }
I see:
1. hide fires on page refresh,
2. when the modal is open and the dropdown button is clicked this._show() fires as expected,
3. when I make a selection from the dropdown menu this._hide() fires as expected, but then,
4. this._hide() fires twice more, closing the dialog - not what I want to have happen.

Anyone have the same experience or an idea of why this happening?


Bob Walsh
I have a tailwindcss-stimulus-components dropdown in a modal. When I make a selection, the modal closes.

I created a custom stimulus controller cloning the code in the package. when I add a couple of alerts to it:

openValueChanged(event) {
    if (this.openValue) {
      this._show()
      alert("got openValueChanged-show")
    } else {
      alert("got openValueChanged-hide")
      this._hide()
    }

  }
I see:
1. hide fires on page refresh,
2. when the modal is open and the dropdown button is clicked this._show() fires as expected,
3. when I make a selection from the dropdown menu this._hide() fires as expected, but then,
4. this._hide() fires twice more, closing the dialog - not what I want to have happen.

Anyone have the same experience or an idea of why this happening?


Notifications
You’re not receiving notifications from this thread.
© 2022 Jumpstart Pro by GoRails, LLC