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

Commit

Permalink
fix (Date Field) ensure the date field does not throw an error in IE11
Browse files Browse the repository at this point in the history
See: #146
  • Loading branch information
Nicholas-Westby committed Aug 15, 2020
1 parent 7683576 commit 9397e13
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ Field.initializeField = function (fieldRenderer, fieldData, fieldValidators, opt
// Create element.
fieldElement = document.createElement(options.nodeName || "input");
if (options.type) {
fieldElement.type = options.type;
try {
fieldElement.type = options.type;
} catch (ex) {

// Fallback for IE11 (throws an error in some cases, such as when type="date").
fieldElement.setAttribute("type", options.type);

}
}
if (options.hasOwnProperty("name")) {
fieldElement.name = options.name;
Expand Down

0 comments on commit 9397e13

Please sign in to comment.