-
Notifications
You must be signed in to change notification settings - Fork 378
feat(Pagination): adds pager #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Pagination): adds pager #254
Conversation
Pull Request Test Coverage Report for Build 815
💛 - Coveralls |
Pull Request Test Coverage Report for Build 977
💛 - Coveralls |
ac130e3 to
8ae0182
Compare
8ae0182 to
49d7fb7
Compare
| return ( | ||
| <ul className={classes}> | ||
| <li className={disablePrevious ? 'previous disabled' : 'previous'}> | ||
| <a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know Patternfly uses anchors but I think we should use buttons. Using <Button bsStyle="link" > provides accessibility and putting disabled on the button uses the disabled cursor and doesn't show the clicks.
We may need to add scss/less to do this but I think it's the right thing to do. Thoughts? I think we should open an issue against Patternfly to support the use of buttons in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether its buttons or anchors, the issue (of disabled buttons not showing appropriate cursor type) will persist so long as this thinggah lurks about https://github.com/patternfly/patternfly/blob/master/src/less/pager.less#L35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SO we can open an issue to fixup the cursor type on disabled.. buttttt doesn't necessarily require the change from anchors to buttons 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting disabled on a button shows the disabled cursor.
Putting disabled on the anchor rather than just on the li actually disables the anchor (no click action). Adding an href would also address the accessibility. At a minimum, we should do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the storybook so yah can see, putting the disabled on the anchor does not remedy the situation as the aforementioned class overrides with cursor: default;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct, no cursor change but it at least it doesn't handle the click (same should be done in pagination row for #253)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? I'm confused, it didn't handle the click before because of line 27, the presence or absence of disabled has no bearings on the triggering of an event 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, you're right. I was being mislead by my eyes and the fact that selecting the Previous button disabled knob is not disabling the previous button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OH THE KNOB ISN'T WORKING great catch, on it.
9555bbc to
51d89a6
Compare
51d89a6 to
eed7986
Compare
|
Or maybe this doesn't need ux review cuz its a preexisting pattern ? 🤷♀️ Storybook has been restored to include pager. |
src/components/Pagination/Pager.js
Outdated
| <li className={disablePrevious ? 'previous disabled' : 'previous'}> | ||
| <a | ||
| href="#" | ||
| className={disablePrevious ? 'disabled' : ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we've been using className={classNames({'disabled': disablePrevious})} for this sort of thing
eed7986 to
67c3850
Compare
67c3850 to
21c0baa
Compare
|
|
e144743 to
429e47f
Compare
src/components/Pagination/Pager.js
Outdated
| } | ||
| }} | ||
| > | ||
| <span className="i fa fa-angle-left" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oooo forgot one other thing... can we use <Icon name="angle-left"> or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise i am totes mcgoates happy 👍
|
@patternfly/patternfly-react-ux |
429e47f to
0f4a381
Compare
|
Are both sets of buttons suppose to be affected by the checkboxes below for disabling? Only the mini ones seem to respond. |
|
Nope only the mini ones @maryclarke |
|
@AllenBW to @maryclarke 's question... WDYT about making additional knobs for disabling the default buttons too (or using the same knobs)? Should be easy enough ;) |
0f4a381 to
8d85cd6
Compare
|
Oh oh apologies @maryclarke @priley86 didn't realize this was a request for change, updated storybook, both buttons now behave exactly the same 🙇♀️ |
|
@AllenBW thanks!! 👍 this looks great to me... @maryclarke anything else here? |
src/components/Pagination/Pager.js
Outdated
| @@ -0,0 +1,86 @@ | |||
| import React from 'react'; | |||
| import PropTypes from 'prop-types'; | |||
| import cx from 'classnames'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh one more thing now... we are rebasing everything to classNames soon in #274 ... do you mind updating this one last thing? I am so sorry 😆
|
Nothing else, LGTM! |
8d85cd6 to
ab0dd2f
Compare
|
@priley86 updated! |
|
awesome! you are the 💣 @AllenBW |
closes #217
Given discussion in #217, gonna rescope this to just be the pager component, the rest isn't desired for implementation
https://AllenBW.github.io/patternfly-react/
☝️ 📚