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): wrapped demo #9726

Closed
wants to merge 4 commits into from
Closed

Conversation

kmcfaul
Copy link
Contributor

@kmcfaul kmcfaul commented Oct 9, 2023

What: Closes #9511

Investigating different approaches overall but throwing this up for now to start a discussion. The 'boiler plate' code like the arrow handling is trickier than I initially thought it would be to extract because its stateful and specific to the example use case. In the typeahead example the function really is there to calculate which index to put the visual focus on, and not the actual arrow key handler which is running internally in Menu.

How does everyone feel about an approach like this where we effectively turn a demo into a wrapper component that we export for use? This way means a user can use a very simple component that internalizes almost all logic if their use case matches the example, and still has the wrapper code to work from if anything needs to be customized.

Right now the new example code shown in the docs is only importing the wrapper, but we could copy that into the same file to show everything in the one place. I initially had everything in the example file, but was running into an issue with exporting the wrapper directly from the examples folder (still looking into that).

@patternfly-build
Copy link
Contributor

patternfly-build commented Oct 10, 2023

@kmcfaul kmcfaul marked this pull request as draft October 11, 2023 19:58
Copy link

stale bot commented Dec 12, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Dec 12, 2023
@stale stale bot closed this Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Select] The new typeahead select implementation is not hiding boilerplate code at all
2 participants