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

Search button - dropdown form #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Search button - dropdown form #119

wants to merge 1 commit into from

Conversation

h3aderon
Copy link
Collaborator

Removed search button, replaced with new search, and added CSS code to match top-header menu

Removed search button, replaced with new search, and added CSS code to match top-header menu
@rgilman
Copy link
Member

rgilman commented Sep 27, 2019

Alex, this is great progress!

... and now I'd like to to take it a next step. As I mentioned on the call, I'd like the search box and button to be the same height. I'd also like the search box and button to stay within the menu area. On our call, I was thinking of having the search box and button cover the top menu but it could also cover the submenu area, like this:

Screen Shot 2019-09-27 at 4 14 54 PM

There may be a simple way to do this that doesn't require foundation – just CSS (like display:hidden except on hover over the search menu item icon).

@iangilman, how would you do this kind of conditional reveal of a text input area?

@iangilman
Copy link
Member

Hmm... There are definitely some nuances to get right if you want to have it appear conditionally. I don't think you would be able to do it all with just CSS. You wouldn't have to use Foundation, of course... You could do it with vanilla JavaScript. I don't know what options Foundation might offer to help with this.

If I was doing it with vanilla JavaScript (or more likely, using jQuery to make it easier), I would indeed have the search area display: hidden by default, and then when you click on the search button it would remove or add a class to the search area to change its display property. Then you'd need to handle when to close it again: when the user hits the search button (or hits return), or when they hit escape (to cancel).

BTW, you'd want your search area to have position: absolute and some additional positioning properties so that it properly overlays the content it's supposed to cover up.

@rgilman
Copy link
Member

rgilman commented Oct 4, 2019

It turns out that Foundation does allow quite a bit of control over positioning – see these plugin options, including data-v-offset, data-h-offset, data-position and data-alignment.

Since we would need JavaScript anyway (can't do it with pure CSS), I recommend we stick with Foundation for now.

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