Back to Reports

Popup Close Button Throws 'Cannot read property 'size' of undefined' Error on Mobile

open May 15, 2020 PluginElementor

Summary:

When a popup is configured to display only on mobile devices, clicking the close button triggers a JavaScript error that prevents the popup from closing. The error occurs in the Elementor frontend code when trying to access a property of an undefined object related to animations.

The root cause appears to be an issue with the popup's animation handling specifically in mobile-only display scenarios. The error suggests that a necessary object for managing the close animation is not properly initialized when the popup is limited to mobile, leading to the 'size' property being read from an undefined variable.

This bug impacts user experience by making popups impossible to close on mobile devices, effectively trapping users on the page.

How to Replicate:

  1. Create a new popup in Elementor.
  2. In the popup settings, limit its display to mobile devices only.
  3. View the page on a mobile device, using a mobile-responsive browser size in devtools, or a responsive testing tool.
  4. Trigger the popup to open. (The report notes no animation plays on open).
  5. Click the popup's close button.
  6. Observe the JavaScript error in the browser console: 'Uncaught TypeError: Cannot read property 'size' of undefined'.