nrkno / core-components

Accessible and lightweight Javascript components
https://static.nrk.no/core-components/latest/
MIT License
117 stars 10 forks source link

Suggested documentation changes for Scroll Usage #666

Closed klizter closed 1 year ago

klizter commented 1 year ago

1.

Buttons can control a core-scroll by targeting its ID and specifying a direction. The disabled attribute is automatically added/removed to controller buttons when there is no more pixels to scroll in specified direction. Important: core-scroll manipulates styling to hide scrollbars, see how to work with margin and height →

->

Buttons can be binded to a <core-scroll />' to control scrolling. Simply use the data-for attribute and hook it up to a <core-scroll /> id. The disabled attribute is automatically toggled when there is no more space to scroll in a particular direction. Note: core-scroll overrides styling to hide scrollbars, see how to work with margin and height →

2.

Note: Starting a core-scroll mousemove inside an iframe, and releasing the mouse outside, will fail to end movement. This is due to mouseup not bubbling though iframes. Please avoid iframes.

->

Note: Starting a core-scroll mousemove inside an iframe, and releasing the mouse outside, will result in a incomplete action. Causing infinite scrolling. This is due to mouseup not bubbling though iframes. Please avoid iframes.