Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popper.js v1 is out #1

Closed
FezVrasta opened this issue Jan 8, 2017 · 4 comments
Closed

Popper.js v1 is out #1

FezVrasta opened this issue Jan 8, 2017 · 4 comments

Comments

@FezVrasta
Copy link

Hi, just wanted to let you know that the v1 is out, maybe you want to update your component.

@nihiluis
Copy link

yeah

@nihiluis
Copy link

nihiluis commented Jan 12, 2017

I think one can update it by replacing the following method in portal-popper.jsx
i'm not sure if applyStyle should be enabled though

I replaced the deprecated modifiersIgnored and updated the onUpdate callback to the new syntax.

componentDidMount () {
    this.popper = new this.props.Popper(this.props.getTargetNode(), this.refs.popper.domNode, {
        content: this.props.title,
        placement: this.props.placement,
      modifiers: {
        applyStyle: {
          enabled: true
        },
        arrow: { 
          element: this.refs.arrow
        }
      }
})

    this.popper.onUpdate = (data) => {
      if (this.isUnmounted) return

      const newState = {}
      if (data.offsets.arrow) newState.arrowProps = data.offsets.arrow
      if (data.offsets.popper) newState.popperProps = data.offsets.popper
      this.setState(newState)
    }

    this.popper.update()
  }

@chrisbreiding
Copy link
Collaborator

@FezVrasta Thanks for the heads up! I'll upgrade as soon as I get a chance. Great library btw!

@nihiluis That's great - thanks for doing the legwork!

@chrisbreiding
Copy link
Collaborator

Upgraded as of 0.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants