Skip to content

Commit e71ee85

Browse files
authored
[WC-3462] Fix Gallery widget JS actions (Reset Filters, Clear Selection) (#2266)
2 parents 997f864 + ba3b764 commit e71ee85

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

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 where "Reset All Filters" and "Clear Selection" JavaScript actions did not work with the Gallery widget. Event listeners were not registered despite the required infrastructure being in place.
12+
913
## [3.11.0] - 2026-05-27
1014

1115
### Added

packages/pluggableWidgets/gallery-web/src/components/GalleryWidget.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import { GalleryRoot as Root } from "./GalleryRoot";
99
import { GalleryTopBar as TopBar } from "./GalleryTopBar";
1010
import { GalleryTopBarControls as TopBarControls } from "./GalleryTopBarControls";
1111
import { RefreshStatus } from "./RefreshStatus";
12+
import { useGalleryJSActions } from "../helpers/useGalleryJSActions";
1213

1314
export function GalleryWidget(): ReactElement {
15+
useGalleryJSActions();
1416
return (
1517
<Root>
1618
<TopBar>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { useOnClearSelectionEvent, useOnResetFiltersEvent } from "@mendix/widget-plugin-external-events/hooks";
2+
import { useGalleryConfig, useSelectActions } from "../model/hooks/injection-hooks";
3+
4+
export function useGalleryJSActions(): void {
5+
const config = useGalleryConfig();
6+
const selectActions = useSelectActions();
7+
8+
useOnResetFiltersEvent(config.name, config.filtersChannelName);
9+
useOnClearSelectionEvent({
10+
widgetName: config.name,
11+
listener: () => selectActions.clearSelection()
12+
});
13+
}

0 commit comments

Comments
 (0)