-
Notifications
You must be signed in to change notification settings - Fork 104
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(filter-menu): add header with search #2330
Conversation
🦋 Changeset detectedLatest commit: e92122a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
this.state.searchTerm = (e.target as HTMLInputElement).value; | ||
this.emit("search-change", this.state.searchTerm); |
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.
Do we want to add an option to filter the results? Like we have with combobox
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.
We can also iterate on this if needed
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 think it's overengineering to add our own filtering option, see the issue description for the results of a discussion with @ianmcburnie
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 don't think this is urgent, and is a "nice to have." @LuLaValva , can you create a separate issue for 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.
Thanks! Added #2331
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.
Looks good overall. One minor bug and a UX gap that we may not be able to do anything at the moment. I just wanted to document it.
}; | ||
} | ||
|
||
handleSearchChange(value: string) { | ||
this.state.searchTerm = value.toLowerCase(); |
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.
Do we not want to save this as a state variable and pass it into the component?
I think we might in case it gets fully rerendered and state is lost?
Otherwise it looks good to me.
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.
This is already protected against rerenders in the <ebay-filter-menu>
component because it stores searchTerm
in its state.
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 there be a usecase where the developer of this component wants to pass in and sync up the state of the search
I'm thinking of page navigations or such.
Generally I think its a good idea to emit the value of the search and then update a parents state and pass that in as input.
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 can't think of a usecase, but I guess there's no harm in adding it. I just pushed a commit that includes this functionality.
93b6ed2
to
ffdea77
Compare
ffdea77
to
e92122a
Compare
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.
Looks great! Let's just create an issue for that feature we can iterate on in the future.
Description
Context
Screenshots