File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ docs = unit # make (createComponent "PaginationExample")
3737 , details = Just $ R .text " 40 results"
3838 }
3939
40+ , example
41+ $ pagination defaults
42+ { currentPage = self.state.currentPage
43+ , pages = 0
44+ , onChange = self.setState <<< flip _{ currentPage = _ }
45+ , details = Just $ R .text " 0 results"
46+ }
47+
4048 , example
4149 $ pagination defaults
4250 { currentPage = self.state.currentPage
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ pagination = makeStateless (createComponent "Pagination") render
3636 let
3737 boundedPage = clamp 0 (props.pages - 1 ) props.currentPage
3838 rangeMin = max 0 (boundedPage - (props.focusWindow / 2 ))
39- rangeMax = min (props.pages - 1 ) (boundedPage + (props.focusWindow / 2 ))
39+ rangeMax = max 0 $ min (props.pages - 1 ) (boundedPage + (props.focusWindow / 2 ))
4040
4141 prevButton =
4242 keyed " prev" $ R .li_
You can’t perform that action at this time.
0 commit comments