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(Dropdown): Added simple template #10308

Merged
merged 6 commits into from
May 8, 2024

Conversation

thatblindgeye
Copy link
Contributor

What: Closes #10303

Additional issues:

@patternfly-build
Copy link
Contributor

patternfly-build commented Apr 26, 2024

Copy link
Contributor

@wise-king-sullyman wise-king-sullyman left a comment

Choose a reason for hiding this comment

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

Would love to see tests for the isToggleFullWidth and shouldFocusToggleOnSelect props added but I won't block for that. This is great 🚀

Copy link
Contributor

@wise-king-sullyman wise-king-sullyman left a comment

Choose a reason for hiding this comment

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

🎸

Copy link
Contributor

@kmcfaul kmcfaul left a comment

Choose a reason for hiding this comment

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

LGTM

For the name - we started with SelectSimple, but we moved to CheckboxSelect/TypeaheadSelect for other templates. I was wondering if we overall wanted to keep the {X}Simple naming pattern for the basic Select/Dropdown templates, or rename them to Simple{X} or just {X} as the import path is different?

Not a blocker, just curious if anyone felt strongly one way or the other.

@thatblindgeye
Copy link
Contributor Author

@kmcfaul I kind of want to suggest "[X]Template[template type]", but depending on how many we actually end up with over time that could get verbose. SelectTemplateSimple, SelectTemplateTypeahead, SelectTemplateMultiTypeahead... Maybe something like that would work better if the API was more <SelectTemplate template="simple" ...otherProps /> or something (not suggesting that for an API, though).

At the very least I think there should be some quantifier attached to the component name. Even though the import path is different, and a consumer could differentiate the import names if they're using both composable and template Select, could just make it easier to outright name them differently.

I've probably gotten used to having the component name start names from our examples/demos, e.g. examples/SelectBasic.tsx etc., so would probably lean towards [Component][Template type] for the template naming. Not sure how strongly I really feel about that, though.

Copy link
Contributor

@jessiehuff jessiehuff left a comment

Choose a reason for hiding this comment

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

I like your suggestion, @thatblindgeye. I feel like "[X]Template[template type]" makes it clearer. I could see it getting pretty verbose like you mentioned though.

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

LGTM

@tlabaj tlabaj merged commit 86dcc02 into patternfly:main May 8, 2024
13 checks passed
kmcfaul pushed a commit to kmcfaul/patternfly-react that referenced this pull request Jun 27, 2024
* feat(Dropdown): Added simple template

* Added tests

* Added imports to example file

* Additional fixes for docs fail

* Updated import name

* Added additional tests
dlabaj pushed a commit that referenced this pull request Jul 2, 2024
* feat(Select): Typeahead template (#10235)

* fix(SelectTypeahead example): make "no results" option aria-disabled

* fix(SelectTypeahead example): don't close the menu on input click when there is text

* fix(SelectTypeahead example): remove visual focus on item after closing the menu

Prevents situation where we open the menu via focusing on the toggle arrow and clicking enter -- then two items can have focus styling, which is not ideal.

* fix(SelectTypeahead example): remove check icon from the selected option when input text changes

* fix(SelectTypeahead example): rename example

* feat(Select): add prop to opt out of focusing first menu item on open

Flag prop shouldFocusFirstMenuItemOnOpen has been added, because of typeahead select, which should keep focus on the input.

* refactor(SelectTypeahead example): adaption on first menu item focused

* feat(MenuToggle): make typeahead toggle button not focusable

* fix(SelectTypeahead example): focus input after toggle button click

* feat(SelectTypeahead example): change the focused item on hover

* fix(SelectTypeahead example): don't focus on first item after tabbing

* feat(Select): add typeahead select template

* fix(SelectTypeahead): address PR review

- new changes were done also based on SelectTypeahead example updates (#10207)

* fix(SelectTypeahead template): call onToggle every time menu opens/closes

* refactor(SelectTypeahead template)

* feat(Select): Typeahead example (#10207)

* refactor(Select): rename shouldFocusFirstMenuItemOnOpen

* feat(SelectTypeahead example): better arrow up/down keys handling

- does not apply visual focus on the first menu option
- handles disabled options
- opens menu on pressing up/down arrow keys

* feat(SelectTypeahead example): don't close menu on clicking clear button when open

* refactor(SelectTypeahead example)

* refactor(SelectTypeahead example)

* fix(SelectTypeaheadCreatable example): changes based on SelectTypeahead

* fix(SelectMultiTypeahead example): changes based on SelectTypeahead

* fix(SelectTypeaheadCreatable example): don't show create option if that exact option exists

* fix(SelectMultiTypeaheadCreatable): changes based on SelectTypeahead

* fix(SelectMultiTypeaheadCheckbox): changes based on SelectTypeahead

* fix(SelectTypeaheadCreatable): close menu after creating option

* fix(SelectTypeahead template): rename prop back to shouldFocusFirstItemOnOpen

* feat(Dropdown): Added simple template (#10308)

* feat(Dropdown): Added simple template

* Added tests

* Added imports to example file

* Additional fixes for docs fail

* Updated import name

* Added additional tests

* feat(templates): toggle props & improvements (#10473)

* feat(templates): toggle props & improvements

* remove toggleContent from typeahead template

* update template names

* update tests

* added SimpleSelect tests

* fix yarnlock

* fix(): update demo-app version and snap

---------

Co-authored-by: adamviktora <[email protected]>
Co-authored-by: Eric Olkowski <[email protected]>
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.

Add basic dropdown template
6 participants