element-x-ada/libraries/mediaviewer
Jorge Martin Espinosa 42c141109f
Fix media viewer flickering (#6800)
* Fix media viewer flickering

This was caused by the data being loaded triggering an index update that got out of sync with the displayed items, and for an instant, the pager index pointed to the wrong data until it was refreshed

* Reuse the same 'displayer' function for both forwards and backwards pagination

* Make `dataFlow` a property so we don't create a new instance every time we access it

* Remove `pageDataComparator` as it prevented new items from being loaded when a pagination returned no valid items to display but has more items to load

Make sure we modify the current index when loading new data only if it was pointing to the input event id.

* Fix `MediaViewerDataSource` overriding the provided timestamp for `Loading` items

Test emitting different loading items from the data source results in the state displaying the different items, so they will trigger a new pagination attempt

* Add regression test to check loading -> error -> loading states will still trigger 2 separate `LoadMore` events
2026-05-20 11:32:32 +02:00
..
api Render media captions formatting in the media viewer (#6729) 2026-05-08 16:30:32 +02:00
impl Fix media viewer flickering (#6800) 2026-05-20 11:32:32 +02:00
test Render media captions formatting in the media viewer (#6729) 2026-05-08 16:30:32 +02:00