Skip to content

Commit 1c3760d

Browse files
committed
fix: use window global object to fetch context
1 parent 2d86021 commit 1c3760d

File tree

7 files changed

+16
-5
lines changed

7 files changed

+16
-5
lines changed

packages/pluggableWidgets/dropdown-sort-web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We fixed an issue with Gallery widget causing errors when Mendix app is being used in an iframe.
12+
913
## [1.2.2] - 2025-03-31
1014

1115
### Fixed

packages/pluggableWidgets/dropdown-sort-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/dropdown-sort-web",
33
"widgetName": "DropdownSort",
4-
"version": "3.3.0",
4+
"version": "3.3.1",
55
"description": "Adds sorting functionality to Gallery widget.",
66
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
77
"license": "Apache-2.0",

packages/pluggableWidgets/dropdown-sort-web/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="DropdownSort" version="3.3.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="DropdownSort" version="3.3.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="DropdownSort.xml" />
66
</widgetFiles>

packages/pluggableWidgets/gallery-web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We fixed an issue with Gallery widget causing errors when Mendix app is being used in an iframe.
12+
913
## [3.4.0] - 2025-09-12
1014

1115
### Fixed

packages/pluggableWidgets/gallery-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/gallery-web",
33
"widgetName": "Gallery",
4-
"version": "3.4.0",
4+
"version": "3.4.1",
55
"description": "A flexible gallery widget that renders columns, rows and layouts.",
66
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
77
"license": "Apache-2.0",

packages/pluggableWidgets/gallery-web/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="Gallery" version="3.4.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="Gallery" version="3.4.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="Gallery.xml" />
66
</widgetFiles>

packages/shared/widget-plugin-sorting/src/react/context.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ export interface SortAPI {
1111

1212
const SORT_PATH = "com.mendix.widgets.web.sortable.sortContext";
1313

14+
// this is a magical way to check if we are running in design preview
15+
const isDesignPreview = window.navigator.appVersion?.startsWith("Mendix Modeler");
16+
1417
export function getGlobalSortContext(): Context<SortAPI | null> {
15-
const scope = window.top === window ? window : window.top;
18+
const scope = isDesignPreview ? window.top : window;
1619
return ((scope as any)[SORT_PATH] ??= createContext<SortAPI | null>(null));
1720
}
1821

0 commit comments

Comments
 (0)