documentcloud / visualsearch

A Rich Search Box for Real Data
http://documentcloud.github.com/visualsearch
MIT License
1.8k stars 237 forks source link

Tab Completion Maintains Previous Text Input #39

Closed jlank closed 11 years ago

jlank commented 12 years ago

Context: Fresh deploy of visual search with example facets and completion terms.

Scenario:

  1. Tab complete "country" facet,
  2. Type in USA,
  3. Tab again to move to the next input fragment
  4. Backspace, Delete USA up until country facet
  5. Tab 2 times, USA comes back

It seems like the "USA" term is being temporarily stored and reconstituted on double tab after deletion. Shouldn't the behavior be more along the lines if you just typed country and tabbed twice, no term is inserted, and you move to the next facet fragment? Maybe this behavior would be different if country had a set of canned countries to choose from, and tabbing through would chose your last selected or top term in that list? For facets that don't have a preset list of values to choose from, tab completing on an ephemeral, user defined term that was just deleted seems counter-intuitive (to me at least)... thoughts?

p.s. I want to contribute so let me know if this behavior is by design or to the contrary, I can work on this

samuelclay commented 12 years ago

Ack, this was asked a while ago. Sorry! But yes, you should totally contribute to this. I am aware of this behavior, but never considered it bad enough. But you're right, it should be doing exactly what you describe. If you write it, I'll stick it in. I suppose it's about time to add a CONTRIBUTORS doc, so if you write this up (use demo.html to test) I'll start that list.

jlank commented 12 years ago

Awesome, I'm finishing up another project and will soon be moving on to one that will utilize VisualSearch. I need to support RTL languages so I may come across some edges that inevitably crop up when swapping a layout from LTR. Looking forward to contributing this fix and some possible enhancements, thanks for the great tool!