{"action":"created","issue":{"url":"https://api.github.com/repos/shuyu/angular-material-fileinput/issues/53","repository_url":"https://api.github.com/repos/shuyu/angular-material-fileinput","labels_url":"https://api.github.com/repos/shuyu/angular-material-fileinput/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/shuyu/angular-material-fileinput/issues/53/comments","events_url":"https://api.github.com/repos/shuyu/angular-material-fileinput/issues/53/events","html_url":"https://github.com/shuyu/angular-material-fileinput/issues/53","id":184033515,"number":53,"title":"Single File - Validation not working properly","user":{"login":"shawnlan","id":3782173,"avatar_url":"https://avatars.githubusercontent.com/u/3782173?v=3","gravatar_id":"","url":"https://api.github.com/users/shawnlan","html_url":"https://github.com/shawnlan","followers_url":"https://api.github.com/users/shawnlan/followers","following_url":"https://api.github.com/users/shawnlan/following{/other_user}","gists_url":"https://api.github.com/users/shawnlan/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnlan/subscriptions","organizations_url":"https://api.github.com/users/shawnlan/orgs","repos_url":"https://api.github.com/users/shawnlan/repos","events_url":"https://api.github.com/users/shawnlan/events{/privacy}","received_events_url":"https://api.github.com/users/shawnlan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-19T18:04:15Z","updated_at":"2016-10-19T19:35:25Z","closed_at":null,"body":"With single file upload, if I first choose a non-valid file, without removing it, select another valid file (overwrite previous one), the validator will not be called. Thus, the input remains invalid.\r\n\r\nThe issue doesn't exist the other way around. Weird."},"comment":{"url":"https://api.github.com/repos/shuyu/angular-material-fileinput/issues/comments/254917492","html_url":"https://github.com/shuyu/angular-material-fileinput/issues/53#issuecomment-254917492","issue_url":"https://api.github.com/repos/shuyu/angular-material-fileinput/issues/53","id":254917492,"user":{"login":"shawnlan","id":3782173,"avatar_url":"https://avatars.githubusercontent.com/u/3782173?v=3","gravatar_id":"","url":"https://api.github.com/users/shawnlan","html_url":"https://github.com/shawnlan","followers_url":"https://api.github.com/users/shawnlan/followers","following_url":"https://api.github.com/users/shawnlan/following{/other_user}","gists_url":"https://api.github.com/users/shawnlan/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnlan/subscriptions","organizations_url":"https://api.github.com/users/shawnlan/orgs","repos_url":"https://api.github.com/users/shawnlan/repos","events_url":"https://api.github.com/users/shawnlan/events{/privacy}","received_events_url":"https://api.github.com/users/shawnlan/received_events","type":"User","site_admin":false},"created_at":"2016-10-19T19:35:25Z","updated_at":"2016-10-19T19:35:25Z","body":"Here is what I found:\r\n\r\nscope.$watch('lfFiles.length') is not reliable enough. I put ctrl.$validate() inside of function readFile to fix this issue.\r\n\r\nAnother thing is that the setTimeout is not set up correctly with setTimeout(readFile(file), i*100);\r\n\r\nIt should be setTimeout(function(){readFile(file);}, i*100);\r\n\r\nOtherwise readFile(file) is called right away."}}
{"actor":{"display_login":"shawnlan"}}