Skip to content
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): add disabled variation #2015

Merged
merged 9 commits into from
Jul 15, 2019

Conversation

christiemolloy
Copy link
Member

@christiemolloy christiemolloy commented Jul 3, 2019

closes #1963

Adds disabled variation for the top pagination component - assuming that we don't need to also show an example for the bottom variation?

@patternfly-build
Copy link

patternfly-build commented Jul 3, 2019

Deploy preview for pf-next ready!

Built with commit 0476188

https://deploy-preview-2015--pf-next.netlify.com

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you need to add pf-m-disabled to your next/last buttons. Other than that, lgtm

@christiemolloy
Copy link
Member Author

Thanks @mattnolting updated!!

@mcoker
Copy link
Contributor

mcoker commented Jul 5, 2019

@christiemolloy looks like in #1973, we missed adding disabled to the toggle. Here's the discussion on it when we added the disabled variation of the dropdown component - #1512 (review) and you'll find it on the dropdown's disabled example - https://pf4.patternfly.org/components/Dropdown/examples/.

And in this PR, we need to add disabled to .pf-c-options-menu__toggle-button, which is covered in the docs above, which are also here in the options menu docs

When [.pf-m-disabled] is used, disabled should also be added to any form elements in .pf-c-options-menu__toggle

{{> pagination-options-menu id="pagination-options-menu-top-disabled-example" options-menu--IsText="true" options-menu-toggle--IsDisabled="true"}}

{{#> pagination-nav}}
{{#> button button--modifier="pf-m-plain pf-m-disabled" button--attribute='aria-label="Go to first page" aria-disabled="true"'}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like in the pagination component, we're using pf-m-disabled wrong. We should be using disabled on buttons and pf-m-disabled on a elements. So these buttons need to be updated to use disabled

Do you want to do that as part of this issue, or a follow up issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do it in this issue

@christiemolloy
Copy link
Member Author

@mcoker updated... Added disabled variation to the plain options menu with text. I also added disabled to both pf-c-options-menu__toggle and pf-c-options-menu__toggle-button .. In the dropdown component I don't see the pf-m-disabled modifier on the buttons, I only see disabled, so i'm a little confused as to what to do there.

Screen Shot 2019-07-08 at 10 45 44 AM

@@ -6,7 +6,7 @@
| -- | -- | -- |
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcoker @jgiardino now that the react implementation is complete should I create an issue to fill in the options menu docs? or do you know if this is still on hold?

@@ -2,10 +2,10 @@
{{> pagination-options-menu id="pagination-options-menu-bottom-example" options-menu--IsText="true"}}

{{#> pagination-nav}}
{{#> button button--modifier="pf-m-plain pf-m-disabled" button--attribute='aria-label="Go to first page" aria-disabled="true"'}}
{{#> button button--modifier="pf-m-plain" button--attribute='disabled aria-label="Go to first page" aria-disabled="true"'}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need aria-disabled, either, if the element has the disabled attribute. @jgiardino can you confirm?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this article it says: "A button with disabled as well as the button with aria-disabled will be labeled as "dimmed button" https://a11y-101.com/development/aria-disabled

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we only need "disabled"

@mcoker
Copy link
Contributor

mcoker commented Jul 8, 2019

On the "Options menu - disabled" and "Options menu - plain
" (disabled) examples, we don't need .pf-m-disabled on the toggle since it's a <button>.

@christiemolloy
Copy link
Member Author

thanks @mcoker updated!

@@ -174,9 +174,9 @@
&:disabled {
pointer-events: none;

&:not(.pf-m-plain) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this gives a background to the plain (non .pf-m-text) button.

Screen Shot 2019-07-09 at 10 32 16 AM

I also don't know that you need the &:not(.pf-m-plain) on L179, either. It's correct code-wise, but seems unnecessary and increases specificity.

What if you rewrote this block to

  &.pf-m-disabled,
  &:disabled {
    pointer-events: none;

    &:not(.pf-m-plain),
    &.pf-m-text {
      --pf-c-options-menu__toggle--Background: var(--pf-c-options-menu__toggle--disabled--BackgroundColor);
    }

    &::before {
      border: 0;
    }
  }

@christiemolloy
Copy link
Member Author

I'm good with that change! updated! @mcoker

@@ -6,7 +6,7 @@
| -- | -- | -- |
| `role` or `aria` | `pf-c-options-menu` | accessibility notes. |
*Note:* The attribute `aria-selected="true"` should be set programmatically to the selected item(s).

| `disabled` | `.pf-c-options-menu__toggle`, `.pf-c-options-menu__toggle-button` | Disables the options menu toggle and toggle button and removes it from keyboard focus. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to move this above the *Note:*

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice!

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@mattnolting mattnolting merged commit 65b5f89 into patternfly:master Jul 15, 2019
@patternfly-build
Copy link

🎉 This PR is included in version 2.20.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants