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

Add button to clear search field #127

Merged
merged 1 commit into from
Sep 28, 2016
Merged

Add button to clear search field #127

merged 1 commit into from
Sep 28, 2016

Conversation

c-lliope
Copy link
Contributor

@c-lliope c-lliope commented Nov 2, 2015

Closes #121.

Problem:

Users cannot clear their search
unless they re-submit the search with an empty field,
or click on the resource link in the navigation bar.

Solution:

Add a button for clearing out the search field
and going back to showing all resources.

customers___administrate_prototype

## To Do - [ ] Only show clear icon when there is text in the search bar - [ ] CHANGELOG

clear_search
expect(page_params).to eq("order=name")
expect(page).to have_content(mismatch.email)

Choose a reason for hiding this comment

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

Extra empty line detected at block body end.

@danbee
Copy link
Contributor

danbee commented Nov 2, 2015

Can I suggest actually putting a button with the word "Clear" on it? Currently it looks a little like a close button.

@danbee
Copy link
Contributor

danbee commented Nov 2, 2015

On reading back I realise my last comment sounded a bit rude. Wasn't meant to be!

@c-lliope
Copy link
Contributor Author

c-lliope commented Nov 2, 2015

@danbee no, you're fine! Would it be better if the X only appeared when there's text in the box? The fading in might give the user context about its meaning.

I'll try it with "Clear" and add a screenshot as well.

@danbee
Copy link
Contributor

danbee commented Nov 2, 2015

Search boxes on Mac's tend to use a cross in a little circle. I'm just knocking up an SVG now to see what it looks like.

@danbee
Copy link
Contributor

danbee commented Nov 2, 2015

How about this?

screen shot 2015-11-02 at 17 26 44

@danbee
Copy link
Contributor

danbee commented Nov 2, 2015

I think it does make sense for the clear button to only appear when there is text in the search box. This mirrors the way I've seen search boxes work elsewhere.

@ACPK
Copy link

ACPK commented Nov 2, 2015

@danbee @Graysonwright This is exactly what I was looking for!

@c-lliope
Copy link
Contributor Author

c-lliope commented Nov 3, 2015

@danbee I like it - did you make that icon?

I've been making custom icons for administrate so far, to avoid copyright issues. If you got that from somewhere, we should check the license or I can just make one up.

@danbee
Copy link
Contributor

danbee commented Nov 3, 2015

I made it myself. Did it by scaling down the existing one and putting a circle around it. I'm not 100% happy with it though so let me make a better one.

@c-lliope c-lliope added this to the 0.1.1 milestone Nov 3, 2015
@@ -38,6 +53,7 @@
}

.search__hint {
z-index: 1;

Choose a reason for hiding this comment

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

Rule sets should be ordered as follows: @extends, @includes without @content, properties, @includes with @content, nested rule sets
Properties should be ordered color, opacity, z-index

@c-lliope c-lliope removed this from the 0.1.1 milestone Nov 8, 2015
@c-lliope c-lliope mentioned this pull request Nov 21, 2015
@ACPK
Copy link

ACPK commented Jan 4, 2016

@Graysonwright Will this be getting pushed?

@zamith
Copy link

zamith commented Jan 4, 2016

What about using the input type search?

@danbee
Copy link
Contributor

danbee commented Jan 4, 2016

input type="search" can be a pain to style.

@zamith
Copy link

zamith commented Jan 4, 2016

@danbee And do we really need to style that?

@danbee
Copy link
Contributor

danbee commented Jan 4, 2016

@zamith To fit the current layout, yes.

@danbee
Copy link
Contributor

danbee commented Jan 4, 2016

Also, the default styling is very inconsistent between different browsers. Safari, for instance, has it's own magic CSS incantations to style certain aspects of it.

@ACPK
Copy link

ACPK commented Jul 7, 2016

What ever happened to this?

@@ -37,6 +56,7 @@
}

.search__hint {
z-index: 1;

Choose a reason for hiding this comment

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

Properties should be ordered color, opacity, transition, z-index

Closes #121.

Problem:

Users cannot clear their search
unless they re-submit the search with an empty field,
or click on the resource link in the navigation bar.

Solution:

Add a button for clearing out the search field
and going back to showing all resources.
@danbee danbee merged commit 85788df into master Sep 28, 2016
@JoelQ JoelQ deleted the gw-clear-search branch October 28, 2016 15:25
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.

5 participants