Skip to content

Commit

Permalink
remove padding from inputs & fix jshint error
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelass committed Oct 12, 2015
1 parent 4f76af8 commit dee060b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions templates/elements/autosize-input/autosize-input.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ input {
margin: 0;
border: none;
font-size: 1em;
border-bottom: 2px solid lightgray;
}
input {
text-transform: capitalize;
padding: 0;
border-bottom: 2px solid lightgray;
}
input:focus {
outline: none;
Expand Down
6 changes: 2 additions & 4 deletions templates/elements/autosize-input/autosize-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@

input.addEventListener('input', (e) => {
dummy.innerText = e.target.value;
let dummyWitdth = window.getComputedStyle(dummy).width;
input.style.width = dummyWitdth;
input.style.width = window.getComputedStyle(dummy).width;

if (e.target.value.length < 1) {
dummy.innerText = input.placeholder;
let dummyWitdth = window.getComputedStyle(dummy).width;
input.style.width = dummy.offsetWidth + 'px';
input.style.width = window.getComputedStyle(dummy).width;
}
});
}
Expand Down

0 comments on commit dee060b

Please sign in to comment.