Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Commit

Permalink
fix(validation): delegate input may be visible, focusable
Browse files Browse the repository at this point in the history
fixes #22
  • Loading branch information
Ray Nicholus committed Oct 25, 2014
1 parent 5bbe284 commit f2fc9ad
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion file-input.js
Expand Up @@ -103,11 +103,21 @@

setupValidationTarget = function(customEl) {
validationTarget = document.createElement("input");
validationTarget.setAttribute("tabindex", "-1");
validationTarget.setAttribute("type", "text");

validationTarget.style.width = 0;
// Strange margin/padding needed to ensure some browsers
// don't hide the validation message immediately after it
// appears (Chrome at this time)
validationTarget.style.padding = "1px";
validationTarget.style.margin = "-1px";

validationTarget.style.border = 0;
validationTarget.style.height = 0;
validationTarget.style.opacity = 0;
validationTarget.style.width = 0;

validationTarget.className = "fileInputDelegate";

validationTarget.customElementRef = customEl;

Expand Down

0 comments on commit f2fc9ad

Please sign in to comment.