Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix(input): don't apply textInput to <input type="file">
Browse files Browse the repository at this point in the history
textInput shouldn't be applied to file inputs to ease writing of custom file input directives.

This change prevents file inputs from instantiating the text input parser/formatter pipelines.

Closes #6247
Closes #6231
  • Loading branch information
twhitbeck authored and caitp committed Feb 13, 2014
1 parent a3846ab commit a9fcb0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ng/directive/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ var inputType = {
'hidden': noop,
'button': noop,
'submit': noop,
'reset': noop
'reset': noop,
'file': noop
};

// A helper function to call $setValidity and return the value / undefined,
Expand Down

1 comment on commit a9fcb0d

@djvs
Copy link

@djvs djvs commented on a9fcb0d May 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently this introduces a new bug where attempting to extract a string from a file input returns nothing. is there a workaround for this?

edit: confirmed, removing line 428 ('file': noop) repairs the bug. isn't it more important to be able to validate file type, file presence etc.? this broke my custom directive https://gist.github.com/djvs/c407d422c1fb63498601 as well as some string-based validations

Please sign in to comment.