{"action":"created","issue":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/1388","repository_url":"https://api.github.com/repos/danialfarid/ng-file-upload","labels_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/1388/labels{/name}","comments_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/1388/comments","events_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/1388/events","html_url":"https://github.com/danialfarid/ng-file-upload/issues/1388","id":136952444,"number":1388,"title":"directive stops working to select more files than allowed","user":{"login":"lkdnvc","id":3207851,"avatar_url":"https://avatars.githubusercontent.com/u/3207851?v=3","gravatar_id":"","url":"https://api.github.com/users/lkdnvc","html_url":"https://github.com/lkdnvc","followers_url":"https://api.github.com/users/lkdnvc/followers","following_url":"https://api.github.com/users/lkdnvc/following{/other_user}","gists_url":"https://api.github.com/users/lkdnvc/gists{/gist_id}","starred_url":"https://api.github.com/users/lkdnvc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkdnvc/subscriptions","organizations_url":"https://api.github.com/users/lkdnvc/orgs","repos_url":"https://api.github.com/users/lkdnvc/repos","events_url":"https://api.github.com/users/lkdnvc/events{/privacy}","received_events_url":"https://api.github.com/users/lkdnvc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-02-27T18:33:14Z","updated_at":"2016-03-05T03:59:25Z","closed_at":null,"body":"ngf-max-files='2' ngf-multiple=\"true\" ngf-keep=\"true\".\r\n\r\n1) select 3 file\r\n2) uploader not work (You can not select a file 1 or 2)\r\n\r\n[jsfiddle example](http://jsfiddle.net/s8kc7wg0/541/)\r\n\r\nthis is a mistake, or i can change the behavior?"},"comment":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/comments/192565387","html_url":"https://github.com/danialfarid/ng-file-upload/issues/1388#issuecomment-192565387","issue_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/1388","id":192565387,"user":{"login":"ray-peters","id":6842438,"avatar_url":"https://avatars.githubusercontent.com/u/6842438?v=3","gravatar_id":"","url":"https://api.github.com/users/ray-peters","html_url":"https://github.com/ray-peters","followers_url":"https://api.github.com/users/ray-peters/followers","following_url":"https://api.github.com/users/ray-peters/following{/other_user}","gists_url":"https://api.github.com/users/ray-peters/gists{/gist_id}","starred_url":"https://api.github.com/users/ray-peters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ray-peters/subscriptions","organizations_url":"https://api.github.com/users/ray-peters/orgs","repos_url":"https://api.github.com/users/ray-peters/repos","events_url":"https://api.github.com/users/ray-peters/events{/privacy}","received_events_url":"https://api.github.com/users/ray-peters/received_events","type":"User","site_admin":false},"created_at":"2016-03-05T03:59:25Z","updated_at":"2016-03-05T03:59:25Z","body":"Hey @danialfarid, thanks for the quick reply.\r\n\r\nWhat should be the expected behavior here? In my opinion, an upload canceled due to reaching the `max-files` limit should not mark the files as invalid.\r\n\r\nFrom my research, the invalid files are tracked in a way that `ngf-keep` will not allow you to upload those files again. Either:\r\n\r\n1. The next `max-files` validation check will return false because `max-files` is compared to ` allFiles.length` when it seems `allValidFiles.length` would be more appropriate, and/or\r\n2. If `ngf-keep-distinct === 'true'` then `removeDuplicates()` will vet all `prevInvalidFiles` from any future attempt to upload.\r\n\r\nWhat do you think?"}}