Skip to content
GitLab
    • Explore Projects Groups Snippets
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
  • !37410

Fix disposing a modal after hiding error

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/ernestob/202210_fix_for_37409_checking_if_property_exists_before_reading_it into main 2 years ago
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: ernestob

Description

Checking if the focus property has been set before reading it.

Motivation & Context

When you dispose a modal after hiding it, it throws an error.

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Live previews

Related issues

Fixes #37409 (closed).

Compare
  • main (base)

and
  • latest version
    a24426c8
    1 commit, 2 years ago

1 file
+ 1
- 1

    Preferences

    File browser
    Compare changes
js/src/modal.js
+ 1
- 1
  • View file @ a24426c8


@@ -188,7 +188,7 @@ class Modal extends BaseComponent {
this._element.classList.add(CLASS_NAME_SHOW)
const transitionComplete = () => {
if (this._config.focus) {
if ("undefined" != typeof this._config.focus && this._config.focus) {
    • XhmikosR
      XhmikosR @XhmikosR · 2 years ago
      Contributor

      we don't use yoda comparisons, please change it to a normal one and make sure lint and tests pass

      • Please register or sign in to reply
Please register or sign in to reply
this._focustrap.activate()
}
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference: stripe-contrib/pagerbot!5
Source branch: github/fork/ernestob/202210_fix_for_37409_checking_if_property_exists_before_reading_it

Menu

Explore Projects Groups Snippets