-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat(select-checkbox): added filter and search input #2693
Conversation
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
|
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.
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 { |
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.
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.
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.
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?
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.
ah gotcha so more reusable this way. Ok, I'm behind on the newest rules for PF :)
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.
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); |
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.
--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 :)
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.
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); |
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.
Should the background position always align with the left padding of the form?
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.
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); |
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.
Should the background-size use font-size or line-height?
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 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. | |
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.
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"}} |
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.
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.
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.
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"')}} |
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.
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?
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.
Love this comment/suggestion. Nice!!!
} | ||
|
||
.pf-c-select__menu-input { | ||
padding-top: var(--pf-c-select__menu-input--PaddingTop); |
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.
could you just do padding: ____ ____ ____ ____
here
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.
PERFECTO
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.
noice!
🎉 This PR is included in version 2.63.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
closes #2565