saxifrage / cityasacampus

An open-source platform for connecting and showcasing resources within local learning communities.
http://cityasacampus.org/
5 stars 4 forks source link

Clicking on search box should remove placeholder text #314

Closed timothyfcook closed 8 years ago

timothyfcook commented 9 years ago

screen shot 2015-10-30 at 9 36 07 am

MatthewVita commented 9 years ago

@timothyfcook this is the native behavior of <input type="text" placeholder="foobar" />. One must begin typing before the placeholder text goes away.

We have 3 options (AFAIK):

  1. Accept this behavior and move on.
  2. Attach a JavaScript event handler to the input such that when in focus the placeholder text is hidden. I am finding this to be a very neat strategy: http://stackoverflow.com/a/9707044 however, instead of keeping the data-holder value in the DOM, we could bind it to an angular scope.
  3. Implement a CSS3 solution. This strategy is incredibly elegant but probably doesn't have the best browser support: http://stackoverflow.com/a/11920714

I think option 3 is the best option. It's the cleanest and forward-thinking. @cameronscott137, do you agree?

cameronscott137 commented 9 years ago

Agreed with @matthewvita's assessment. I'd be more concerned about the fact that text entered on the home page search field appears simultaneously in the navbar search field. @matthewvita, any thoughts there?

On Sun, Nov 1, 2015 at 3:47 AM, Matthew Vita notifications@github.com wrote:

@timothyfcook https://github.com/timothyfcook this is the native behavior of . One must begin typing before the placeholder text goes away.

We have 2 options (AFAIK):

  1. Accept this behavior and move on.
  2. Attach a JavaScript event handler to the input such that when in focus, the placeholder text is hidden.

— Reply to this email directly or view it on GitHub https://github.com/saxifrage/cityasacampus/issues/314#issuecomment-152807754 .

Cameron (610) 883-7342

MatthewVita commented 9 years ago

@cameronscott137 okay, I'll implement the 3rd option.

As for the simultaneously text, it's because there's a data-binding on term shared with the navbar and homepage. Not sure it's a problem from a UX standpoint. What would be a better way to implement it?

timothyfcook commented 9 years ago

Option 3 sounds good. It just looked awkward with the typing prompt covering the placeholder text.

I don't care too much about the data-binding showing up in the navbar. Although it does seem a bit funny. It's like when you click the topic buttons it's just auto-populating a search for you...

MatthewVita commented 8 years ago

pr assigned to Cameron here: https://github.com/saxifrage/cityasacampus/pull/345