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