question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple modale on the same page in a programmatic way

See original GitHub issue

Hello,

I’m trying to have one modale per row on a talbe. I found #1424 but it’s not working in my case.

On each row on my table, I got a component that renders a modale:

<confirmation-modale
    :id="'team_' + row.item.id"
    ...
    :action-route="generateDetachRoute(row.item.id)">
</confirmation-modale>
// inside the confirmation-modale
<button :v-b-modal="id" :class="finalClass">{{ btnLabel }}</button>
    <b-modal
      :id="id"
      ref="confirmationModaleRef"
      :title="trans('confirmation')"
      :ok-title="trans('submit')"
      no-close-on-backdrop
      hide-header-close
      :visible="showModal"
    >
   ...

It’s either I don’t have this code, and all the modale opens when I click on one button, and with this code shared, no modale opens. What am I missing please ?

Also, I close this modale programatically, so do I need to customize the ref prop to make it unique so It only close 1 modale or not? this.$refs.<variable>.hide() ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tmorehousecommented, Dec 3, 2017

That issues is probably due to the z-inzex values, and the fact that your modal is inside the table cells.

1reaction
tmorehousecommented, Dec 3, 2017

And I just notices that you are also using the visible prop when also using the v-modal directive.

If all of your modals are tied to the same value of visible, you will run into issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating Multiple Modals on a Single Page - Stack Overflow
In the below example I use two modals, but you can use more. You just set the id in the modal class elements...
Read more >
Handling Multiple Modals on One Page with Vanilla JS
Handling Multiple Modals on One Page with Vanilla JS. Here is a little JS snippet for opening and closing multiple modals on a...
Read more >
multiple modal on same page, each modal with his own button
how can i setting to use multiple modal, each button open his own modal with dynamic content??
Read more >
Create Multiple Modals on web page using single JavaScript.
In this video, you will know how to create multiple modal using a single code of javascript.#CB Tech , #Programming.
Read more >
Modal - Bootstrap
Modals are built with HTML, CSS, and JavaScript. · Clicking on the modal “backdrop” will automatically close the modal. · Bootstrap only supports...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found