Closed connor closed 12 years ago
if you target more than one element, only the last one gets focused, since only one can be focused at a time.
you'll want to only focus the first item in the selection. and also for build purposes, edit the file in the src/
directory
cool. will fix that tonight and edit my pull request.
@ded I figured I should keep the code that iterates over all the selection and blurs it, just for more flexibility. If someone targets a class of inputs, and calls blur()
on them, I figure it should blur them all no matter what, not just the first one. However, if they are doing that for focus()
, I think it makes sense to focus only the first one.
Anyways - the updated code's there. Let me know if you want me to change anything else!
You'll probably want a test of some kind in focus()
that makes sure you don't get an exception when this.length==0
.
right. thanks for catching that! just coded up the fix really quick and didn't even consider that. will adjust this and make a new Pull Request!