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
  • !12142

In modals we can't specify if certain elements can be focused or not

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/mkurz/master into master Jan 07, 2014
  • Overview 0
  • Commits 2
  • Pipelines 0
  • Changes 1

Created by: mkurz

This is basically an improved version of pr #11686, only with some small fixes. Please have a look on the describtion in #11686, which covers the problem in detail.

IMHO this pull request introduces only a small code change with no side affects but fixes (or better: allow to fix) a lot of issues users are experiencing using bootstrap in conjunction with other heavily used libraries like select2 or CKEditor.

Right now people using workarounds like disabling the Modal.prototype.enforceFocus function or overriding it (like https://github.com/twbs/bootstrap/issues/6996#issuecomment-23617382). This is not the best approach e.g. when upgrading bootstrap you have to check for changes in the enforceFocus function and apply it to the overriden one.

With this fix, all you have to do is declaring the allowFocus function to fix any problems with other libraries, e.g. for select2 this would be:

$.fn.modal.Constructor.prototype.allowFocus = function (e) {
    return !!$(e.target).closest('.select2-drop');
};

I (and probably lot's of other developers) would highly appreciate if this pr gets merged.

Thanks!

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/mkurz/master