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
  • #29996
Closed
Open
Issue created Jan 10, 2020 by Administrator@rootContributor

Dropdown doesn't work with null popperConfig

Created by: afrische

Error Message will be DROPDOWN: Option "popperConfig" provided type "window" but expected type "(null|object)".

Could be caused by Angular, as i and other users use Bootsrtap in conjunction with Angular. Other users have the same problem: https://stackoverflow.com/questions/59628601/dropdown-bootstrap-4-doesnt-work-in-production-of-angulars-application

  • Operating system and version (Windows, macOS, Android, iOS, Win10 Mobile) Windows
  • Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser) Firefox 68 ESR
  • Reduced test case and suggested fix using CodePen or JS Bin

Cause seems to be with the toType method, and the typecheck in Dropdown.

$ typeof null
> "object"
$ const toType = obj => ({}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase())
$ toType(null)
> "window"

Expected type for popperConfig is null | object

For me it is not intuitive why toType(null) should return window, and not null

Assignee
Assign to
Time tracking