Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ import { withThemeByClassName } from '@storybook/addon-themes';
import docJson from '../documentation.json';
import { providePrimeNG } from 'primeng/config';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { GalleriaItemSlot } from 'primeng/galleria';

// Fix PrimeNG bug: GalleriaItemSlot's main item slot has no `type` attribute,
// so the `item` setter's forEach loop never matches and context stays stale on updates.
(function patchGalleriaItemSlot() {
const desc = Object.getOwnPropertyDescriptor(GalleriaItemSlot.prototype, 'item');
if (desc?.set) {
const orig = desc.set;
Object.defineProperty(GalleriaItemSlot.prototype, 'item', {
...desc,
set(value: unknown) {
orig.call(this, value);
if ((this as any).context?.$implicit !== value) {
(this as any).context = { $implicit: value };
}
}
});
}
}());

import Preset from '../src/lib/providers/prime-preset/theme.preset';

Expand Down
Loading