Skip to content

Modal doesn't open without popper.min.js #24304

Closed

Description

@iamrealmarsel

Modal component doesn't work without including popper.min.js before bootstrap.js, console shows the error "Bootstrap dropdown require Popper.js"
Bootstrap v4

Activity

  1. Johann-S commented on Oct 9, 2017

    @Johann-S
    Member

    Indeed Bootstrap depends on Popper.js for our Tooltips/Dropdown and Popovers plugins.

    @XhmikosR what do you think about moving this test : https://github.com/twbs/bootstrap/blob/v4-dev/js/src/tooltip.js#L15-L21 in our plugins constructor ?
    Because folks who don't need to use those components, should be able to do that without this error

  2. added
    jsJavaScript or TypeScript sources and plugins
    v4v4, the frozen docs on gh-pages
    on Oct 9, 2017
  3. XhmikosR commented on Oct 9, 2017

    @XhmikosR
    Member

    @Johann-S: wouldn't it then throw for people who don't want to use those components?

    How about we have an extra global var like needsPopper and act accordingly in our constructor?

  4. Johann-S commented on Oct 9, 2017

    @Johann-S
    Member

    Nope people we'll only see this error if they are trying to use our Dropdowns/Tooltips or Popovers
    seems a bit redundant because we can simply check if Popper is available or not

  5. XhmikosR commented on Oct 9, 2017

    @XhmikosR
    Member

    @Johann-S: please make a PR and CC me.

  6. Johann-S commented on Oct 9, 2017

    @Johann-S
    Member

    Finally it seems we have no solution here (see : #24306)
    so @m01key you have to add Popper.js because 3 of our plugins use it or you can wait for our next release which will add a new dist file with Popper.js inside

  7. XhmikosR commented on Oct 9, 2017

    @XhmikosR
    Member

    Either we do what I suggested and throw in the constructor if a component which requires popper is used, or we leave it as it. Otherwise it will throw an error even though one might not use a popper descendant component.

  8. Johann-S commented on Oct 9, 2017

    @Johann-S
    Member

    Maybe I don't see how you'll do that but for me it wont change anything because our plugins are wrapped into IIFE ended with : })($, Popper)

  9. XhmikosR commented on Oct 9, 2017

    @XhmikosR
    Member

    True that. Not sure if there's another way to do things, but with our current implementation I don't think we can do a lot.

  10. Johann-S commented on Oct 9, 2017

    @Johann-S
    Member

    true, it's hard to add optional dep 😟

  11. Johann-S commented on Oct 25, 2017

    @Johann-S
    Member

    Maybe instead of throwing an error we should just use console.warn ? @XhmikosR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    jsJavaScript or TypeScript sources and pluginsv4v4, the frozen docs on gh-pages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions