Skip to content

Releases: bamlab/react-tv-space-navigation

v5.1.0

15 Oct 17:37
Compare
Choose a tag to compare

5.1.0 (2024-10-15)

This is technically a breaking version, but only people that updated to 5.0.0 will be affected.

The new additionalItemsRendered property was not correct. It was defaulting to 4, but the minimum value was 2, which was not clear at all.

We made 0 the new minimum value, and shifted values by 2.
New default value becomes 2 (equivalent to 4 previously).

If you customized this property, you can remove 2 to the value and it should be equivalent (except in the case of jump-on-scroll behaviour).

⚠ BREAKING CHANGES

  • lists: make additionally rendered items less error prone (#163)

Bug Fixes

  • lists: make additionally rendered items less error prone (#163) (7b3f7ea)

v5.0.0

08 Oct 08:46
Compare
Choose a tag to compare

5.0.0 (2024-10-08)

⚠ BREAKING CHANGES

  • VirtualizedList: remove numberOfElementsVisibleOnScreen and numberOfElementsRendered props (#153)

Features

  • add onLongSelect prop to Node (7dfae9a)
  • VirtualizedList: remove numberOfElementsVisibleOnScreen and numberOfElementsRendered props (#153) (2268059)

Migration guide (should be quick)

Switching to the new version

In the latest version, the numberOfItemsVisibleOnScreen and numberOfItemsRendered props have been removed from the virtualized lists and grid API. The numberOfItemsVisibleOnScreen is now calculated automatically based on the parent view size.

Both of these props have been replaced by a new optional prop called additionalItemsRendered. This prop controls the number of items rendered just outside the visible screen (but not yet virtualized). It allows you to fine-tune the virtualization size without the need to manually calculate numberOfItemsVisibleOnScreen, which could lead to incorrect values.

 <SpatialNavigationVirtualizedList
   data={data}
   renderItem={renderItem}
   itemSize={itemSize}
-  numberOfItemsVisibleOnScreen={5}
-  numberOfItemsRendered={8}
+  additionalItemsRendered={3} // optional
 />

How to Update to the New Version

To migrate to the new version, you'll need to remove the numberOfItemsVisibleOnScreen and numberOfItemsRendered props from all instances of SpatialNavigationVirtualizedList and SpatialNavigationVirtualizedGrid.

By default, you don't need to provide a value for additionalItemsRendered. However, if you want to replicate the behavior of the previous version exactly, you can set additionalItemsRendered to numberOfItemsRendered - numberOfItemsVisibleOnScreen. This will ensure the same number of off-screen items are rendered.

Impact on Tests

Your tests may also break, as the number of visible items is now calculated based on the size of the parent view. This number will vary depending on the execution environment. For example, in Jest, where the window width is 750 px, the calculation will be based on that width.

v4.0.1

13 Sep 08:40
Compare
Choose a tag to compare

4.0.1 (2024-09-13)

Bug Fixes

  • lists: fix imperative focus not working properly on android (#149) (e7a38ef)
  • lists: range rendered in jump-on-scroll and stick-to-end (#148) (d9509dc)

v4.0.0

01 Aug 13:47
Compare
Choose a tag to compare

4.0.0 (2024-08-01)

⚠ BREAKING CHANGES

  • scrollview: add CSS scroll on ScrollView (#146)
    • This changed the ScrollView and its behaviour. You should try it, it should work better. If it causes any issue, you may use the new useNativeScroll flag on the scroll view.

Features

  • scrollview: add CSS scroll on ScrollView (#146) (cc9e4cd)

After

scrollview_after.mov.mp4

Before

scrollview_before.mov.mp4

v3.6.1

27 May 10:02
Compare
Choose a tag to compare

3.6.1 (2024-05-27)

Bug Fixes

  • lists: fix imperative focus not always working on virtualized lists (bec7a62)

v3.6.0

06 May 13:50
Compare
Choose a tag to compare

3.6.0 (2024-05-06)

Features

  • core: add isRootActive mechanism (0d6d8f0)

Bug Fixes

  • remove error when recreating node (c0f0e3d)

v3.5.0

30 Apr 14:57
Compare
Choose a tag to compare

3.5.0 (2024-04-30)

Features

  • lists: add index in renderItem arguments (91e35df)

Bug Fixes

  • lists: fix lists not working properly with few elements with stick-to-start (bd9d139)

v3.4.0

19 Apr 16:32
Compare
Choose a tag to compare

3.4.0 (2024-04-19)

Features

v3.3.0

19 Apr 16:31
Compare
Choose a tag to compare

3.3.0 (2024-04-11)

Bug Fixes

  • core: fix double registering of elements (ac64a63)
  • race conditions with default focus (656738d)

v3.2.0

09 Apr 13:25
Compare
Choose a tag to compare

3.2.0 (2024-04-09)

Features

  • Add onActive and onInactive props to SpatialNavigationNode (e79c480)
  • nodes can take an additional scrolloffset (b87654b)