question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Popper] onUpdate / onCreate not handled

See original GitHub issue

onUpdate and onCreate options are overridden in the Popper component, making it difficult to access internal data about the popout / get lifecycle callbacks.

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

The popperOptions should support onUpdate and onCreate as per docs (https://github.com/FezVrasta/popper.js#callbacks). i.e. Popper callbacks should be fired when PopperJS creates or “updates” a popup.

Current Behavior 😯

The callbacks do not fire, as they are overridden in the wrapping MUI Popper component.

Steps to Reproduce 🕹

Try to use onUpdate or onCreate options: i.e. <Popper popperOptions={{ onUpdate: data => console.log(data) }} />

Link:

  1. https://codesandbox.io/s/822z0prqz2

Context 🔦

I am trying to get a callback when the popup is created and get the dimensions of the rendered component.

Your Environment 🌎

Tech Version
Material-UI v3.6.0
React v16.8.1
Browser Chrome
TypeScript No

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Apr 10, 2019

@jaipe No objection 😃

0reactions
JaiPecommented, Apr 15, 2019

@oliviertassinari Sorry - I took a while!! Added a test to your fix, thank you 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Popper] onUpdate / onCreate not handled #15262 - GitHub
I am trying to get a callback when the popup is created and get the dimensions of the rendered component. Your Environment. Tech,...
Read more >
0.10.1 - react-popper - npm
Handling DOM Elements from React can be complicated. The Manager and Target components handle these complexities for you, so their use is ...
Read more >
Popper (v1.×)
The dataObject is an object containing all the information used by Popper.js. This object is passed to modifiers and to the onCreate and...
Read more >
Team:PYMS GZ China/JS popper - iGEM 2020
offsetParent will return the closest TH, TD or TABLE in case // no ... will call `onCreate` callback // the other ones will...
Read more >
mithriljs/mithril.js - Gitter
When oncreate is called, vnode.dom is defined. But when view is called, vnode.dom is only defined within callbacks. So I can't destructure the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found