Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/scrollBoard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function calcAligns(mergedConfig, header) {
return deepMerge(aligns, align)
}

const ScrollBoard = forwardRef(({ onClick, config = {}, className, style, onMouseOver }, ref) => {
const ScrollBoard = forwardRef(({ onClick, config = {}, className, style, onMouseOver, onScroll }, ref) => {
const { width, height, domRef } = useAutoResize(ref)

const [state, setState] = useState({
Expand Down Expand Up @@ -268,6 +268,11 @@ const ScrollBoard = forwardRef(({ onClick, config = {}, className, style, onMous

const animationNum = carousel === 'single' ? 1 : rowNum

if (onScroll) {
const { pause, resume } = task.current || {}
onScroll({ animationIndex, pause, resume, ele: task.current })
}

let rows = rowsData.slice(animationIndex)
rows.push(...rowsData.slice(0, animationIndex))
rows = rows.slice(0, carousel === 'page' ? rowNum * 2 : rowNum + 1)
Expand Down Expand Up @@ -412,6 +417,7 @@ ScrollBoard.propTypes = {
config: PropTypes.object,
onClick: PropTypes.func,
onMouseOver: PropTypes.func,
onScroll: PropTypes.func,
className: PropTypes.string,
style: PropTypes.object
}
Expand Down