-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[New Component] Search Field #1985
Conversation
@@ -0,0 +1,54 @@ | |||
let React = require('react'); |
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.
const
I agree with @oliviertassinari that this field could use a more general name like TypeAhead. Other than that, olivier has given some good code feedback that I would encourage you to look at. And we're being careful to merge new features with documentation, so @yongxu could you please look into that when you get a chance? :-) Great stuff, thanks @yongxu |
Thanks @oliviertassinari , Great review. |
What about When in doubt, we can stick to the terms used in the actual Material docs: |
Looks like the material spec define two differents names, a |
@newoga The next step is to make it work like this, I am going to work on it. |
👍 Looking forward to it @yongxu |
Really need this to merge. |
@oliviertassinari @yongxu Is there an example for testing out this component. Or can you point me in the right direction? |
@vijayrawatsan I am working on it! Should be able to work it out in the next 24 hours. |
a5d0926
to
c15ecfa
Compare
I have made a few updates on the component, also changed its name to AutoComplete. It should be ok to use in development, though there are few features I have in mind that I haven't had time to implement yet. I will be really busy before Wednesday, sorry about that. I think this version should be good enough to merge. I will keep working on it after Wednesday. Feel free to make it better if you like! @vijayrawatsan @oliviertassinari @shaurya947 Happy Halloween BTW :) |
c15ecfa
to
88758e4
Compare
I did not squash these 2 commits so that you can see what has been changed, I think it is probably reasonable to kept it this way so that we can trace back if needed. If you think the rebase is needed I will be happy to do that too. |
Changes look good to me @yongxu. If you can address the issue pointed out by @s0meone before we merge, that would be great! Other than that, I'll let @oliviertassinari review this too (and merge) :-) |
@yongxu Too god mate. |
By the way @yongxu this one has a very good api |
I don't agree, see moroshko/react-autosuggest#71 |
I really liked it just because of one missing feature you can't just say its bad. |
@vijayrawatsan I not saying that their API is bad. What I mean by
However, they do have IMO good properties like showWhen |
@oliviertassinari |
@yongxu @oliviertassinari
|
}}> | ||
<div | ||
style={{ | ||
widht:'100%', |
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.
Misspelled width
.
@yongxu What do you think about their API http://react-toolbox.com/#/components/autocomplete |
88758e4
to
c28be97
Compare
bug fixed
c28be97
to
da64e9a
Compare
@s0meone That has been fixed @dlindahl Thank you for the review. problems have been fixed! @oliviertassinari @shaurya947 I think it should be good enough to merge now! |
|
||
getDefaultProps() { | ||
return { | ||
fullWidth: false, |
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 have a dataSource: [],
as a default value?
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.
If dataSource
is null, then it will call onUpdateRequests
. This was left uninitialized on purpose.
@oliviertassinari @shaurya947 I think this component should be ready to merge, what do you guys think? |
@yongxu thanks for the reply: But that will hide the extra text. What if that text is very important. And I want to wrap it instead of not showing it. Is there any hack for it. (I am not asking you to support this feature, just asking for some hack.) |
@oliviertassinari dataSource // for list proprity
/* function(searchText,prevDataSource) -> if return a list,
then replace dataSource with that list,
otherwise use the dataSource from props */
onUpdateInput
//and
onNewRequest(searchText,index,dataSource) //if no match then index = null Or use the name @vijayrawatsan I will add that in the next pull request! Sorry I have been too overloaded lately. I am going to make another update as soon as you guys agree on the name. So I will do it tonight or this weekend and make a nice finish. I am not sure how much time I will be able to help before Dec, but I will do my best. I know this component may not be perfect yet, but I think we should merge it so others can use it in their project or improve it when I am not available. |
Sounds good to me.
IMHO it's not needed for the autocomplete, but why not. Can we make those two callbacks, not expecting any returned value?
We will merge as soon as the API is stable 👍. Thank for the time you spent on this! |
@yongxu I fixed the wrapping by adding innerDivStyle: { overflow: 'hidden' , whiteSpace: 'normal'} Also there is one bug I would like to report. No you press backspace to remove letter 'e'. Now the dropdown should show 4 results but it only show 1 result, rest is empty space in dropdown. This is fixed when I turn animated: false while creating menu. |
@vijayrawatsan I suspect the bug is from src/menus/menu.jsx However I realized I should make I will make auto-complete stable today and ready to merge today, then we can fix the animated issue in another issue report. |
created new PR because of the component name change. |
How do I limit the number of results displayed in the menu? For example, I have 4000 options and I want to display only 10 in the menu. |
Bumps [cypress](https://github.com/cypress-io/cypress) from 4.8.0 to 4.10.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Commits](cypress-io/cypress@v4.8.0...v4.10.0) Signed-off-by: dependabot-preview[bot] <[email protected]> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
This is an update from #1446.
Review needed.
Sorry don't have time to do the document now. Maybe someone else could help on that.
@oliviertassinari @shaurya947