Skip to content

Commit

Permalink
fixed the select element don't have .select()
Browse files Browse the repository at this point in the history
  • Loading branch information
kelp404 committed Sep 29, 2016
1 parent 62a3d15 commit 8399826
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion dist/angular-validator.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-validator.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/directive.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ angular.module 'validator.directive', ['validator.provider']
if args.error?() is 1
# scroll to the first element
try element[0].scrollIntoViewIfNeeded()
element[0].select()
if element[0].select
element[0].select()
else
element[0].focus()
return

registerRequired = ->
Expand Down

0 comments on commit 8399826

Please sign in to comment.