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
  • #23478
Closed
Open
Issue created Aug 16, 2017 by Administrator@rootContributor

PreventDefault on callBack hide function bug

Created by: LuigiOnGitHub

Hi in Bootstrap (v4.0.0-beta): modal.js release I found that the following code in Modal.prototype.hide function (starting line 1982 of bootstrap.js)

var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
if (transition) {
  this._isTransitioning = true;
}

should be put after the hideEvent trigger otherwise the property isTransitioning will be true at the next call and therefore a not prevented callback on hide will be inhibited.

correct code starting at line 1982 should be:

var hideEvent = $.Event(Event.HIDE);

$(this._element).trigger(hideEvent);

if (!this._isShown || hideEvent.isDefaultPrevented()) {
  return;
}

var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);

if (transition) {
    this._isTransitioning = true;
}

regards

Assignee
Assign to
Time tracking