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.

Portal/Popups incompatible with preact-compat

See original GitHub issue

TL;DR

When using Popups with preact-compat, the event object passed to handleOpen from the associated Portal does not contain a currentTarget property, due to the way the event object is being cloned. This throws an error, preventing the Popup from being displayed when it is triggered by a mouse event.

Steps

  1. Create an application using preact-cli.
  2. Install semantic-ui-react (and semantic-ui-css) as described in its documentation.
  3. Alias preact-compat in place of React using Webpack, overriding the webpack config using the method described in preact-cli’s documentation.
  4. Render a Popup component like so:
const Component = () => <Popup trigger={<p>Hover me</p>} />
  1. Mouse over the rendered component

Expected Result

  • Popup is displayed.

Actual Result

  • Popup is not displayed.
  • Error thrown:
TypeError: Cannot read property `getBoundingClientRect' of undefined

Version

0.71.4

Testcase

Unable to provide test case, unless CodePen allows module aliasing

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
jimmedcommented, Aug 16, 2017

@layershifter Thanks for the response, and I understand that this is not an intended use case. I’ve started work on a fix, but won’t raise a PR until I have proper test cases established.

0reactions
iMericacommented, Aug 16, 2018

Issue persists for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Switching to Preact (from React)
Everything you need to know to switch from React to Preact. ... Setting up compat; PureComponent; memo; forwardRef; Portals; Suspense (experimental) ...
Read more >
TgX - River Thames Conditions - Environment Agency - GOV.UK
Saudinet call rates, Pop indo terbaru 2012, Bangladesh president list, ... Universal studios hollywood music, Croatia serbia conflict, Aberdeen box office ...
Read more >
2022-23 PSAT™ 8/9 Coordinator Manual
audio, Assistive Technology–Compatible (ATC), or braille format, you'll receive test ... Call UPS at 800-PICK-UPS (742-5877) to arrange pickup of materials.
Read more >
Preact - Releases
Bug Fixes. Add an explicit default export for compatibility with esbuild (#3783, thanks @Verseth); Fix useId uniqueness with shared parents + DOM nodes...
Read more >
Untitled
K-pop extreme survival stand up lyrics, College roger poulnard bage la ville, Abbildungsmatrix ... Nsic delhi admission 2015, Zenfolio login problems?
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