Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #33324
Closed
Open
Issue created Mar 10, 2021 by Administrator@rootContributor

Modal data-bs-dismiss and data-bs-target

Created by: ray73864

Currently modals support a 'data-bs-target' with the 'data-bs-toggle' attribute, that way if you have a 'data-bs-toggle' of 'Modal' it knows which Modal to actually open.

I would love to see 'data-bs-dismiss' also support a 'data-bs-target' attribute if one is present.

Right now, I am free to open a modal, then while that modal is being displayed, open another one and have the new one on top, which is great for at work, in my case, modalOne is for adding a not on file part number to a customer quote, and modalTwo is for a markup calculator that modalOne can open (This is for our stores), I used to do all this using Bootbox, but since moving to BS5 for all my new stuff and completely dropping jQuery, I can't use Bootbox anymore.

The problem is that if you close modalTwo, it also closes modalOne, so what I have done is when modalTwo opens, I add a custom event to the btn-close (I removed 'data-bs-dismiss' from the button) and also overrode the 'escape' key, in both instances when you click the 'X' on modalTwo or press escape, it closes only modalTwo and takes you back to the correct field on modalOne.

If there was a 'data-bs-target' available for 'data-bs-dismiss', then I could tell it which modal it is to close.

Hopefully that all makes sense.

Assignee
Assign to
Time tracking