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
  • Merge requests
  • !34092

Backdrop: Fix stale body by removing unnecessary default

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/weaverryan/fresh-backdrop-body into main May 24, 2021
  • Overview 13
  • Commits 3
  • Pipelines 0
  • Changes 2

Created by: weaverryan

Hi there!

I'm using Turbo, where the entire body element is swapped out at times. This causes a bug with Backdrop, as it stores the original body element in the Default object. This is the flow:

  1. Open a Modal / Backdrop
  2. Navigate to another page (i.e. swap the body for a new body Element)
  3. Open another Modal / Backdrop

On (3), the Backdrop will append itself to the original body Element from (1), not the new body element.

Also, the default is unnecessary: in _getConfig(), if config.rootElement is falsy, then it already defaults to document.body (which is why I didn't add any tests: there are tests already to make sure the rootElement can be configured):

https://github.com/twbs/bootstrap/blob/136665903b50988002380f512342dcb584e1bed4/js/src/util/backdrop.js#L93

Please let me know if any tweaks are needed.

Thanks!

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/weaverryan/fresh-backdrop-body