limestone/Scroller
Provides Limestone-themed scroller components and behaviors.
Loading Live Preview
Loading Live Preview
Members
Section titled “Members ”Scroller Component
Section titled “Scroller   Component ”A Limestone-styled Scroller, useScroll applied.
Usage:
<Scroller>Scroll me.</Scroller> Extends:
ui/Scrollerui/Scroller.ScrollerBasic
Properties
aria-label
Section titled “aria-label”The "aria-label" for the Scroller.
When aria-label is set and focusableScrollbar is byEnter, it will be used
instead to provide an accessibility label for the Scroller.
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.
{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'.{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 bynode.
Note: Only specify one of:
position,align,node
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 topdata-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.
Direction of the scroller.
Default: 'both'editable
Section titled “editable”Enables editing items in the scroller. You can specify props for editable scroller as an object. See the details in limestone/Scrollerlimestone/Scroller.EditableShape
fadeOut
Section titled “fadeOut”Adds fade-out effect on the scroller.
Set this to true only if the content has no spottable but text.
Default: falseNote: Fade-out effect will not show if the
directionis set toboth.
Allows 5-way navigation to the scroll thumb.
By default, 5-way will not move focus to the scroll thumb.
If true, the scroll thumb will get focus by directional keys.
If 'byEnter', scroll thumb will get focus first by directional keys,
then the scroll body will get focus by enter key or back key pressed on scroll thumb.
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 Scroller is within a limestone/Panelslimestone/Panels.Panel, the
Scroller will store its scroll position and restore that position when returning to the
Panel.
noScrollByWheel
Section titled “noScrollByWheel”Prevents scroll by wheeling on the scroller.
Default: falseonScroll
Section titled “onScroll”Called when scrolling.
Passes scrollLeft, scrollTop.
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 and scrollTop.
Example:
onScrollStart = ({scrollLeft, scrollTop}) => {
// do something with scrollLeft and scrollTop
}
render = () => (
<Scroller
...
onScrollStart={this.onScrollStart}
...
/>
)onScrollStop
Section titled “onScrollStop”Called when scroll stops.
Passes scrollLeft and scrollTop.
Example:
onScrollStop = ({scrollLeft, scrollTop}) => {
// do something with scrollLeft and scrollTop
}
render = () => (
<Scroller
...
onScrollStop={this.onScrollStop}
...
/>
)scrollbarTrackCss
Section titled “scrollbarTrackCss”Customizes the component by mapping the supplied collection of CSS class names to the corresponding internal elements and states of this component.
The following classes are supported:
scrollbarTrack- The scrollbarTrack component classthumb- The scrollbar thumb component class
Specifies how to scroll.
Default: 'native'scrollToContentContainerOnFocus
Section titled “scrollToContentContainerOnFocus”Scrolls to the container created by limestone/Scrollerlimestone/Scroller.ContentContainerDecorator when descendants get focused.
Default: truestickTo
Section titled “stickTo”Anchors the focused item to a fixed "focus position" while the content scrolls beneath it.
When set to 'start' and direction is 'horizontal', moving focus with 5-way keys keeps
the focus indicator at a fixed slot near the start (left in LTR, right in RTL) edge of the
scroller and scrolls the list so the newly focused item lands in that slot. At the end of the
list, when the item can no longer reach the fixed slot, the list scrolls only to its last
position so the focused item (including its full width) stays visible.
By default (undefined), the scroller scrolls just enough to bring the focused item into view.
Specifies how to show vertical scrollbar.
Default: 'auto'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')ContentContainerDecorator Higher-Order Component
Section titled “ContentContainerDecorator   Higher-Order Component ”Wraps a component to be a scroll target when its descendants get focused.
EditableWrapper Component
Section titled “EditableWrapper   Component ”A Limestone-styled EditableWrapper.
Properties
editable
Section titled “editable”Enables editing items in the scroller. You can specify props for editable scroller as an object. See the details in limestone/Scrollerlimestone/Scroller.EditableShape
Obtains a reference to the scroll container handle.
Obtains a reference to the scroll container node.
Obtains a reference to the scroll content node.
Type Definitions
Section titled “Type Definitions ”EditableShape Object
Section titled “EditableShape   Object ”The shape for editable of limestone/Scrollerlimestone/Scroller.
The callback function called when editing is finished.
It has an event object contains orders array which app can use for repopulate items.
Obtains a reference to blurItem function.
If you would like to remove focused CSS class to an item, you can get the reference to blurItem function via useRef.
blurItem function needs to be called with an item node when an item is blurred.
Centers the contents of the scroller.
Customizes the component by mapping the supplied collection of CSS class names to the corresponding internal elements and states of this component. The following classes are supported:
wrapper- The content wrapper component classselected- The selected item classfocused- The focused item class
Obtains a reference to focusItem function.
If you would like to use focused CSS class to an item, you can get the reference to focusItem function via useRef.
focusItem function needs to be called with an item node when an item is focused.
Obtains a reference to hideItem function.
If you would like to hide an item, you can get the reference to hideItem function via useRef.
Obtains a reference to removeItem function.
If you would like to remove an item, you can get the reference to removeItem function via useRef.
Decides how to start editing items.
It can be either 'press' or 'longPress'. If unset, it defaults to 'longPress'.
Obtains a reference to showItem function.
If you would like to show an item, you can get the reference to showItem function via useRef.