Galleria: GalleriaItem activeItem
has stale reference when value
array is changed.
#11882
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
GalleriaItem
activeItem
has a stale reference whenvalue
array is changed.The
activeItem
reference is setup whenever theactiveIndex
is set. This causes an issue whenever thevalue
array is updated, without changing theactiveIndex
, as theactiveItem
is still referencing the previous object.Environment
Standard PrimeNG and Angular application
Reproducer
No response
Angular version
13.3.9
PrimeNG version
13.4.1
Build / Runtime
TypeScript
Language
TypeScript
Node version (for AoT issues node --version)
16.14.2
Browser(s)
No response
Steps to reproduce the behavior
value
input of a Galleria component, for instance, the example in the showcase documentation.value
array, for example, reversing the order of the image objects.GalleriaItem.activeItem
will be referencing the initialvalue
objectExpected behavior
When the
value
array is updated, the full component tree should update accordingly to the new object sources, without needing to manually change theactiveIndex
The text was updated successfully, but these errors were encountered: