@primestyleai/tryon 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -450,6 +450,15 @@ function PrimeStyleTryonInner({
450
450
  if (domResult.buttonClicked) {
451
451
  setTimeout(() => {
452
452
  const afterClick = scanAfterClick();
453
+ try {
454
+ document.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape", bubbles: true }));
455
+ } catch {
456
+ }
457
+ try {
458
+ const closeBtn = document.querySelector("[role=dialog] button[aria-label*=close], [class*=modal] button[class*=close], [aria-modal=true] button");
459
+ if (closeBtn) closeBtn.click();
460
+ } catch {
461
+ }
453
462
  if (afterClick.found && afterClick.headers && afterClick.rows) {
454
463
  setSizeGuide({ found: true, headers: afterClick.headers, rows: afterClick.rows });
455
464
  setSizeGuideFetching(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",