haltersweb / Accessibility

Accessible solutions to web widgets and applications
http://haltersweb.github.io/Accessibility/
MIT License
125 stars 28 forks source link

Autocomplete #6

Closed ghost closed 5 years ago

ghost commented 7 years ago

I'm not understanding how to use this?

haltersweb commented 7 years ago

Hi Kodecount,

(sorry for the delay in getting back to you. I'm so behind on keeping up with my GitHub.)

Can you be more specific on what understanding your looking for? Is it about how to interact with the autocomplete widget or is it about how to integrate it into your code?

Thanks,

Adina

jelewis8 commented 6 years ago

Are you still maintaining this library? This is pretty fantastic, but I'm having trouble figuring out how a real list of data would work--presumably it should filter by alphabet (typing an A gives you all the A results, and so on) but this appears to be manually selecting results based on number of characters typed into the box, which isn't really useful in a real world setting. Any thoughts on this?

jelewis8 commented 6 years ago

Okay, I did some tinkering and I think I've got an update for this to do alphabetical filtering instead.

function fakeAjaxResults() { var filter = $input.val(); // get the value of the input, which we filter on var newResults = [];

$(fakeResults).each(function(index, value) { //if element starts with input value if (value.substr(0, filter.length) == filter) { //add element to new array newResults.push(value); } }); return newResults; }