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

Searching text prop (Rebased #141) #379

Merged
merged 3 commits into from
Aug 24, 2015

Conversation

bruderstein
Copy link
Collaborator

This is a rebased version of #141 from @johnomalley, with some tests added.

This makes sense to me, if you change autoload to false in the remote options example, and type a, you get No results and a spinner for half a second, then the results come in. With the patch, it shows Searching..., customisable by the searchingText prop.

I've left the code pretty much as is (I'm with @johnomalley on it, the if makes it more readable). I've removed the IIFE though, as there doesn't seem any advantageous, and creates another function scope and another bind - feel free to show where I'm missing something.

Tests for the new functionality added in a separate commit.

JJOMAL and others added 2 commits August 13, 2015 21:38
Removed IIFE, as there was no advantage to wrapping the `if` statement in an IIFE.
We were abusing .Select-noresults to also hold the `Searching...`
and `searchPromptText`. This commit fixes that, so that each type of
text has its own className.  This makes JedWatson#221 redundant, as you can 
hide the div with a simple css rule, if you want to hide it.
@dcousens
Copy link
Collaborator

@bruderstein looks good! I personally find that the less indentation and syntax there is, the less I have to grok in my head, but I guess that is just a style thing 👍 , it was a nit, my main gripe was the unnecessary IIFE.

Thanks for rebasing!
Over to you @JedWatson

@@ -2389,6 +2389,69 @@ describe('Select', function() {
});
});

describe('searchingText', function () {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Note this function padding will end up failing happiness once the bug is fixed in eslint.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

because of the blank line after the function () {?

Eeee. Funnily enough, that's the hapi style, which I like, and find it makes it much easier to read, I also saw that there is a blank line after many functions.

We'll need to do a clean up of all the tests if that gets accepted. I really don't like that it seems to fail on node 0.10 though.

@JedWatson
Copy link
Owner

This looks great, thanks for cleaning it up @bruderstein!

JedWatson added a commit that referenced this pull request Aug 24, 2015
@JedWatson JedWatson merged commit a0242a9 into JedWatson:master Aug 24, 2015
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.

3 participants