Skip to content

Commit

Permalink
fix(Paging): disable forward button when current page is last (#3273)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackUait committed Sep 22, 2023
1 parent 5653505 commit 9b3a0b7
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/react-ui/components/Paging/Paging.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const styles = memoizeStyle({
pageLinkDisabled(t: Theme) {
return css`
color: ${t.linkDisabledColor};
pointer-events: none;
`;
},

Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/components/Paging/Paging.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export class Paging extends React.PureComponent<PagingProps, PagingState> {
styles.pageLink(this.theme),
styles.forwardLink(this.theme),
focused && styles.pageLinkFocused(this.theme),
disabled || (this.props.disabled && styles.pageLinkDisabled(this.theme)),
(disabled || this.props.disabled) && styles.pageLinkDisabled(this.theme),
)
: cx({
[styles.forwardLink(this.theme)]: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,16 @@ export const DisabledPaging = () => {
};
DisabledPaging.parameters = {
creevey: {
skip: { in: /^(?!\b(chrome|chromeDark)\b)/ },
skip: { in: /^(?!\b(chrome|chromeDark|chrome2022|chrome2022Dark)\b)/ },
},
};

export const PagingDisabledForwardLink = () => {
return <Paging onPageChange={emptyHandler} activePage={8} pagesCount={8} />;
};
PagingDisabledForwardLink.parameters = {
creevey: {
skip: { in: /^(?!\b(chrome|chromeDark|chrome2022|chrome2022Dark)\b)/ },
},
};

Expand Down

0 comments on commit 9b3a0b7

Please sign in to comment.