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(select-checkbox): added filter and search input #2693

Merged
merged 8 commits into from
Feb 13, 2020
Merged

feat(select-checkbox): added filter and search input #2693

merged 8 commits into from
Feb 13, 2020

Conversation

mattnolting
Copy link
Contributor

closes #2565

@patternfly-build
Copy link

patternfly-build commented Feb 10, 2020

PatternFly-Next preview: https://patternfly-next-pr-2693.surge.sh

Preview: https://patternfly-next-pr-2693.surge.sh

A11y report: https://patternfly-next-pr-2693-coverage.surge.sh

CSS Size Report
NameCurrentPreviousDiff %
components/FormControl/form-control.css13.0 kB11.8 kB9.35
components/Select/select.css17.9 kB17.4 kB3.11
patternfly.min.css570.5 kB568.8 kB0.30
patternfly-no-reset.css648.0 kB646.2 kB0.27
patternfly.css649.8 kB648.0 kB0.27
patternfly-ie11.css511.3 kB510.6 kB0.13

Copy link
Contributor

@matthewcarleton matthewcarleton left a comment

Choose a reason for hiding this comment

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

nice work! Just a few minor questions.

@@ -443,6 +451,23 @@
padding-top: var(--pf-c-select__menu-group--not-first--PaddingTop);
}

.pf-c-select__menu-group {
&.pf-m-padding {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use a modifier here for padding? Wouldn't it always need the padding? If it is a modifier should it be called padding? I didn't think we named them like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we're using .pf-m-padding in some components (.pf-c-drawer most recently) where padding is a boolean and pre-configured. This is what I thought to be the most flexible approach as we build out functionality in the future opting for existing, generic elements over specific elements like .pf-c-select__filter. Wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

ah gotcha so more reusable this way. Ok, I'm behind on the newest rules for PF :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and that var is wrong, lol

--pf-c-select__menu-group--m-padding--PaddingBottom: var(--pf-c-select__menu--PaddingBottom);
--pf-c-select__menu-group--m-padding--PaddingLeft: var(--pf-c-select__menu-item--PaddingLeft);
--pf-c-select__menu-group--m-padding--not--first-of-type--PaddingTop: var(--pf-global--spacer--md);
--pf-c-select__menu-group--m-padding--not--last-of-type--PaddingBottom: var(--pf-global--spacer--md);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
--pf-c-select__menu-group--m-padding--not--last-of-type--PaddingBottom: var(--pf-global--spacer--md);
--pf-c-select__menu-group--m-padding-not--last-of-type--PaddingBottom: var(--pf-global--spacer--md);

same question as above :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above

@@ -72,6 +77,13 @@ $pf-c-form-control--success--Coordinates: "M504 256c0 136.967-111.033 248-248 24
--pf-c-form-control--success--check--Background: var(--pf-c-form-control--success--BackgroundUrl) var(--pf-c-form-control--success--BackgroundPosition) / var(--pf-c-form-control--success--BackgroundSize) no-repeat;
--pf-c-form-control--success--Background: var(--pf-c-form-control--BackgroundColor) var(--pf-c-form-control--success--check--Background);

// Input m-search
--pf-c-form-control--m-search--PaddingLeft: var(--pf-global--spacer--xl);
--pf-c-form-control--m-search--BackgroundPosition: var(--pf-c-form-control--PaddingLeft);
Copy link
Member

Choose a reason for hiding this comment

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

Should the background position always align with the left padding of the form?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, because the clear (x) appears on the right by default in the input="search"

// Input m-search
--pf-c-form-control--m-search--PaddingLeft: var(--pf-global--spacer--xl);
--pf-c-form-control--m-search--BackgroundPosition: var(--pf-c-form-control--PaddingLeft);
--pf-c-form-control--m-search--BackgroundSize: var(--pf-c-form-control--FontSize) var(--pf-c-form-control--FontSize);
Copy link
Member

Choose a reason for hiding this comment

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

Should the background-size use font-size or line-height?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied these settings from the previous examples

@@ -196,6 +203,7 @@ The checkbox select can select multiple items using checkboxes. The number of it
| `.pf-c-select__menu-fieldset` | `<fieldset>` | Initiates a fieldset for the items in a checkbox select. |
| `.pf-c-select__menu-group` | `<div>` | Initiates a group within a select menu. |
| `.pf-c-select__menu-group-title` | `<div>` | Initiates a title for a group with a select menu. |
| `.pf-m-padding` | `.pf-c-select__menu-group` | Adds padding to group. |
Copy link
Member

Choose a reason for hiding this comment

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

Change comment to something similar to this: "Modifies the select menu group to add extra padding."

@@ -0,0 +1,4 @@
{{#> select-menu-group select-menu-group--modifier="pf-m-padding"}}
Copy link
Member

Choose a reason for hiding this comment

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

Should we follow what is in the context selector component? It has its own element wrapper for the input. The advantage of this is that it is specific for adding an input in it. While the modifier that you're applying to the pf-c-select__menu-group keeps it flexible, it may mean that users use it for the wrong reasons other than what its meant for.

Screen Shot 2020-02-11 at 1 49 39 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably should do that. If in the future we want to add .pf-c-select__menu-group.pf-m-padding in the future, we can.

@@ -0,0 +1,4 @@
<div class="pf-c-select__menu-input{{#if select-menu-input--modifier}} {{select-menu-input--modifier}}{{/if}}">
{{#> form-control controlType="input" form-control--modifier="pf-m-search" form-control--attribute=(concat 'type="search" id="' id '-search-input" name="' id '-search-input" aria-label="Search"')}}
Copy link
Member

Choose a reason for hiding this comment

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

What if in the future we want to put a different type of input into this wrapper? I guess we could leave this and then add a condition inside of here to either show search or a different type of input, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Love this comment/suggestion. Nice!!!

}

.pf-c-select__menu-input {
padding-top: var(--pf-c-select__menu-input--PaddingTop);
Copy link
Member

Choose a reason for hiding this comment

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

could you just do padding: ____ ____ ____ ____ here

Copy link
Member

@christiemolloy christiemolloy left a comment

Choose a reason for hiding this comment

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

PERFECTO

Copy link
Contributor

@matthewcarleton matthewcarleton left a comment

Choose a reason for hiding this comment

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

noice!

@christiemolloy christiemolloy merged commit c2e17a6 into patternfly:master Feb 13, 2020
@redallen
Copy link
Contributor

🎉 This PR is included in version 2.63.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.

6 participants