# Lightbox Bug on Mobile — \`wixWindow.closeLightbox()\` Fails but Click Logs Fire

**URL:** <https://forum.wixstudio.com/t/lightbox-bug-on-mobile-wixwindow-closelightbox-fails-but-click-logs-fire/70846>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [May 10, 2025, 4:06am UTC](https://forum.wixstudio.com/t/lightbox-bug-on-mobile-wixwindow-closelightbox-fails-but-click-logs-fire/70846 "2025-05-10T04:06:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TonyasDDesigns](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/tonyasddesigns/32/99417_2.png) [@TonyasDDesigns](https://forum.wixstudio.com/u/TonyasDDesigns)\
**Post date:** [May 10, 2025, 4:06am UTC](https://forum.wixstudio.com/t/lightbox-bug-on-mobile-wixwindow-closelightbox-fails-but-click-logs-fire/70846/1 "2025-05-10T04:06:53Z")

</div>

Hi everyone,

I’m reporting what appears to be a critical bug with lightboxes on mobile devices.  
Any help is _greatly_ appreciated.

**What I’m Trying to Do:**  
I’m using a lightbox as a mobile navigation menu, and I want to close it when the user clicks a text button (styled as an X) in the top-right corner.

**Setup:**

- Button Type: Text Button
- ID: closeIcon
- Placed inside the lightbox
- Not grouped, not hidden, not collapsed
- Lightbox code is active and correctly targeting the button

**Code I Used (Expected to Work):**

import wixWindow from ‘wix-window’;

$w.onReady(function () {  
$w(‘#closeIcon’).onClick(() =\> {  
wixWindow.closeLightbox();  
});  
});

**What Happens:**

- When I tap the X button, the console logs fire properly (“CLICKED” appears)
- The button is active and responds to touch
- But the lightbox does not close — not in Preview or on Live mobile site
- Even alternate buttons inside the lightbox fail to close it using .closeLightbox()

**Workaround That Does Work:**  
I replaced the closeLightbox() call with a redirect to the page the user is on, and that forces the lightbox to close.

import wixLocation from ‘wix-location’;

$w.onReady(function () {  
$w(‘#closeIcon’).onClick(() =\> {  
wixLocation.to(wixLocation.url); // Reloads current page  
});  
});

\*\ ***This gives the illusion that the menu was closed,** and the user experience is clean — but this is only a workaround.

**My Question:**  
Is this a known Wix issue?  
Why does wixWindow.closeLightbox() trigger the log but fail to actually close the lightbox on mobile?

 ![ScreenShot Tool -20250509232338](https://us1.discourse-cdn.com/wix/original/3X/3/b/3b8e83fdef2b625c7c595ddd3af6e5422698ba12.png)

Would appreciate an official answer or known fix.  
Thanks so much.  
— Tonya
