limestone/VirtualList
Provides Limestone-themed virtual list components and behaviors.
Members
Section titled “Members ”VirtualList Component
Section titled “VirtualList   Component ”A Limestone-styled scrollable and spottable virtual list component.
Extends:
ui/VirtualListui/VirtualList.VirtualListBasic
Properties
Required Property • itemSize
Section titled “Required Property • itemSize”Size of an item for the VirtualList; valid value is a number generally.
For different item size, value is an object that has minSize
and size as properties.
If the direction for the list is vertical, itemSize means the height of an item.
For horizontal, it means the width of an item.
Usage:
<VirtualList itemSize={ri.scale(144)} />cbScrollTo
Section titled “cbScrollTo”A callback function that receives a reference to the scrollTo feature.
Once received, the scrollTo method can be called as an imperative interface.
The scrollTo function accepts the following parameters:
{position: {x, y}} - Pixel value for x and/or y position
{align} - Where the scroll area should be aligned. Values are:
'left','right','top','bottom','topleft','topright','bottomleft', and'bottomright'.{index} - Index of specific item. (
0or positive integer) This option is available for onlyVirtualListkind.{node} - Node to scroll into view
{animate} - When
true, scroll occurs with animation. Whenfalse, no animation occurs.{focus} - When
true, attempts to focus item after scroll. Only valid when scrolling byindexornode.
Note: Only specify one of:
position,align,indexornode
Example:
// If you set cbScrollTo prop like below;
cbScrollTo: (fn) => {this.scrollTo = fn;}
// You can simply call like below;
this.scrollTo({align: 'top'}); // scroll to the topcontinue5WayHold
Section titled “continue5WayHold”When this value is true, scrolling in a VirtualList with holding a 5-way key continues to outer Scoller.
data-webos-voice-disabled
Section titled “data-webos-voice-disabled”Disable voice control feature of component.
data-webos-voice-focused
Section titled “data-webos-voice-focused”Activates the component for voice control.
data-webos-voice-group-label
Section titled “data-webos-voice-group-label”The voice control group label.
The layout direction of the list.
Default: 'vertical'Specifies how to show horizontal scrollbar.
Default: 'auto'horizontalScrollThumbAriaLabel
Section titled “horizontalScrollThumbAriaLabel”Sets the hint string read when focusing the scroll thumb in the horizontal scroll bar.
Default: $L('scroll up or down with up down button')hoverToScroll
Section titled “hoverToScroll”Enables scroll by hover on edges in scroll direction.
Unique identifier for the component.
When defined and when the VirtualList is within a limestone/Panelslimestone/Panels.Panel,
the VirtualList will store its scroll position and restore that position when returning to
the Panel.
noScrollByWheel
Section titled “noScrollByWheel”Prevents scroll by wheeling on the list.
Default: falseonScroll
Section titled “onScroll”Called when scrolling.
Passes scrollLeft, scrollTop, and moreInfo.
It is not recommended to set this prop since it can cause performance degradation.
Use onScrollStart or onScrollStop instead.
onScrollStart
Section titled “onScrollStart”Called when scroll starts.
Passes scrollLeft, scrollTop, and moreInfo.
You can get firstVisibleIndex and lastVisibleIndex from VirtualList with moreInfo.
Example:
onScrollStart = ({scrollLeft, scrollTop, moreInfo}) => {
const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
// do something with firstVisibleIndex and lastVisibleIndex
}
render = () => (
<VirtualList
...
onScrollStart={this.onScrollStart}
...
/>
)onScrollStop
Section titled “onScrollStop”Called when scroll stops.
Passes scrollLeft, scrollTop, and moreInfo.
You can get firstVisibleIndex and lastVisibleIndex from VirtualList with moreInfo.
Example:
onScrollStop = ({scrollLeft, scrollTop, moreInfo}) => {
const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
// do something with firstVisibleIndex and lastVisibleIndex
}
render = () => (
<VirtualList
...
onScrollStop={this.onScrollStop}
...
/>
)The ARIA role for the list.
Default: 'list'scrollMode
Section titled “scrollMode”Specifies how to scroll.
Valid values are:
'translate','native'.
spotlightId
Section titled “spotlightId”The container id for spotlight/SpotlightContainerDecorator/#SpotlightContainerDecoratorspotlight/SpotlightContainerDecorator/#SpotlightContainerDecorator.spotlightId.
It is a required prop to restore focus after remounting VirtualList.
For example, with this prop specified, when a VirtualList is used in a limestone/Panelslimestone/Panels.Panel,
the Spotlight will store the last focus information based on SpotlightId while navigating to another Panel.
And the VirtualList will restore the focus when it remounts while the navigation returns to the Panel.
stickTo
Section titled “stickTo”Anchors the focused item to a fixed "focus position" at the start edge while the list scrolls beneath it.
When set to 'start', moving focus with 5-way keys keeps the focus indicator at a fixed slot
at the start of the list (top for vertical, leading edge for horizontal) and scrolls so the
newly focused item lands in that slot. At the end of the list, the list scrolls only to its
last position so the focused item stays visible.
This is ignored when snapToCenter is set.
Specifies how to show vertical scrollbar.
Valid values are:
'auto','visible', and'hidden'.
verticalScrollThumbAriaLabel
Section titled “verticalScrollThumbAriaLabel”Sets the hint string read when focusing the scroll thumb in the vertical scroll bar.
Default: $L('scroll left or right with left right button')When it's true and the spotlight focus cannot move to the given direction anymore by 5-way keys,
a list is scrolled with an animation to the other side and the spotlight focus moves in wraparound manner.
When it's 'noAnimation', the spotlight focus moves in wraparound manner as same as when it's true
except that a list is scrolled without an animation.
Valid values are:
false,true, and'noAnimation'
VirtualGridList Component
Section titled “VirtualGridList   Component ”A Limestone-styled scrollable and spottable virtual grid list component.
Extends:
ui/VirtualListui/VirtualList.VirtualListBasic
Properties
Required Property • itemSize
Section titled “Required Property • itemSize”Size of an item for the VirtualGridList; valid value is an object that has minWidth
and minHeight as properties.
Usage:
<VirtualGridList
itemSize={{
minWidth: ri.scale(360),
minHeight: ri.scale(540)
}}
/>cbScrollTo
Section titled “cbScrollTo”A callback function that receives a reference to the scrollTo feature.
Once received, the scrollTo method can be called as an imperative interface.
The scrollTo function accepts the following parameters:
{position: {x, y}} - Pixel value for x and/or y position
{align} - Where the scroll area should be aligned. Values are:
'left','right','top','bottom','topleft','topright','bottomleft', and'bottomright'.{index} - Index of specific item. (
0or positive integer) This option is available for onlyVirtualListkind.{node} - Node to scroll into view
{animate} - When
true, scroll occurs with animation. Whenfalse, no animation occurs.{focus} - When
true, attempts to focus item after scroll. Only valid when scrolling byindexornode.
Note: Only specify one of:
position,align,indexornode
Example:
// If you set cbScrollTo prop like below;
cbScrollTo: (fn) => {this.scrollTo = fn;}
// You can simply call like below;
this.scrollTo({align: 'top'}); // scroll to the topcontinue5WayHold
Section titled “continue5WayHold”When this value is true, scrolling in a VirtualGridList with holding a 5-way key continues to outer Scroller.
data-webos-voice-disabled
Section titled “data-webos-voice-disabled”Disable voice control feature of component.
data-webos-voice-focused
Section titled “data-webos-voice-focused”Activates the component for voice control.
data-webos-voice-group-label
Section titled “data-webos-voice-group-label”The voice control group label.
The layout direction of the list.
Default: 'vertical'Specifies how to show horizontal scrollbar.
Default: 'auto'horizontalScrollThumbAriaLabel
Section titled “horizontalScrollThumbAriaLabel”Sets the hint string read when focusing the scroll thumb in the horizontal scroll bar.
Default: $L('scroll up or down with up down button')hoverToScroll
Section titled “hoverToScroll”Enables scroll by hover on edges in scroll direction.
Unique identifier for the component.
When defined and when the VirtualGridList is within a limestone/Panelslimestone/Panels.Panel,
the VirtualGridList will store its scroll position and restore that position when returning to
the Panel.
noAffordance
Section titled “noAffordance”Removes affordance area on the list.
Set this to true only if the item needs to stick to the bottom for vertical direction,
to the right for horizontal direction, when scrolling by keys.
noScrollByWheel
Section titled “noScrollByWheel”Prevents scroll by wheeling on the list.
Default: falseonScroll
Section titled “onScroll”Called when scrolling.
Passes scrollLeft, scrollTop, and moreInfo.
It is not recommended to set this prop since it can cause performance degradation.
Use onScrollStart or onScrollStop instead.
onScrollStart
Section titled “onScrollStart”Called when scroll starts.
Passes scrollLeft, scrollTop, and moreInfo.
You can get firstVisibleIndex and lastVisibleIndex from VirtualGridList with moreInfo.
Example:
onScrollStart = ({scrollLeft, scrollTop, moreInfo}) => {
const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
// do something with firstVisibleIndex and lastVisibleIndex
}
render = () => (
<VirtualGridList
...
onScrollStart={this.onScrollStart}
...
/>
)onScrollStop
Section titled “onScrollStop”Called when scroll stops.
Passes scrollLeft, scrollTop, and moreInfo.
You can get firstVisibleIndex and lastVisibleIndex from VirtualGridList with moreInfo.
Example:
onScrollStop = ({scrollLeft, scrollTop, moreInfo}) => {
const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
// do something with firstVisibleIndex and lastVisibleIndex
}
render = () => (
<VirtualGridList
...
onScrollStop={this.onScrollStop}
...
/>
)The ARIA role for the list.
Default: 'list'scrollMode
Section titled “scrollMode”Specifies how to scroll.
Valid values are:
'translate','native'.
snapToCenter
Section titled “snapToCenter”When it's true, the item snaps to center.
spotlightId
Section titled “spotlightId”The container id for spotlight/SpotlightContainerDecorator/#SpotlightContainerDecoratorspotlight/SpotlightContainerDecorator/#SpotlightContainerDecorator.spotlightId.
It is a required prop to restore focus after remounting VirtualGridList.
For example, with this prop specified, when a VirtualGridList is used in a limestone/Panelslimestone/Panels.Panel,
the Spotlight will store the last focus information based on SpotlightId while navigating to another Panel.
And the VirtualGridList will restore the focus when it remounts while the navigation returns to the Panel.
stickTo
Section titled “stickTo”Anchors the focused item to a fixed "focus position" at the start edge while the list scrolls beneath it.
When set to 'start', moving focus with 5-way keys keeps the focus indicator at a fixed slot
at the start of the list (top for vertical, leading edge for horizontal) and scrolls so the
newly focused item lands in that slot. At the end of the list, the list scrolls only to its
last position so the focused item stays visible.
This is ignored when snapToCenter is set.
Specifies how to show vertical scrollbar.
Valid values are:
'auto','visible', and'hidden'.
verticalScrollThumbAriaLabel
Section titled “verticalScrollThumbAriaLabel”Sets the hint string read when focusing the scroll thumb in the vertical scroll bar.
Default: $L('scroll left or right with left right button')When it's true and the spotlight focus cannot move to the given direction anymore by 5-way keys,
a list is scrolled with an animation to the other side and the spotlight focus moves in wraparound manner.
When it's 'noAnimation', the spotlight focus moves in wraparound manner as same as when it's true
except that a list is scrolled without an animation.
Valid values are:
false,true, and'noAnimation'