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: Use floating-ui/react for the autosuggest input in the pixel code sample #24

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

anandgorantala
Copy link
Contributor

@anandgorantala anandgorantala commented Aug 15, 2024

Prototypes using the floating-ui/react library to setup the search input with autosuggest with keyboard support. Using this as an example to inform the API of the Search input component

Preview: https://codesandbox.io/p/devbox/next-js-x7lvq6

@anandgorantala anandgorantala changed the title feat: Use floating-ui/react for the autosuggest input in the pixel co… feat: Use floating-ui/react for the autosuggest input in the pixel code sample Aug 15, 2024
@@ -5,6 +5,7 @@
],
"rules": {
"camelcase": "off",
"react/jsx-props-no-spreading": "off",

Choose a reason for hiding this comment

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

I sometime just hate the arbitrary opinions in eslint, this is one of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I need to switch this to one of the standard eslint configs, haven't gotten around to it yet, but I will in the next couple of weeks

Copy link

@feixie1980 feixie1980 left a comment

Choose a reason for hiding this comment

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

The changes look good to me.

I do find that the use floating-ui is adding some new abstractions such as Floating manager, which are a little less straightforward than the previous code. It is pretty easy to figure out what those are, but does require me a little extra work to understand it.

What are the major motivation to use floating-ui? Is it just much easier for building the UI we want?

@anandgorantala
Copy link
Contributor Author

The floating-ui library adds keyboard navigation and handling of the pop up, it's positioning, etc. This change serves as a proof of concept for the new search bar component. That will encapsulate a lot of the code that's in the SearchBar component right now. Once that component is ready, it will replace most of the current SearchBar component code

@anandgorantala anandgorantala merged commit d84edd9 into main Aug 20, 2024
18 checks passed
@anandgorantala anandgorantala deleted the floating-ui branch August 20, 2024 16:31
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.

2 participants