Skip to content

Commit

Permalink
Use data-value attribute to keep real input value not only caption
Browse files Browse the repository at this point in the history
  • Loading branch information
ar-post committed Jul 10, 2017
1 parent fd25eb2 commit 0e865c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion getmdl-select.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion getmdl-select.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/js/getmdl-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
[].forEach.call(list, function (li) {
li.onclick = function () {
input.value = li.textContent;
input.setAttribute( 'data-value', li.getAttribute('data-value') );
dropdown.MaterialTextfield.change(li.textContent); // handles css class changes
setTimeout( function() {
dropdown.MaterialTextfield.updateClasses_(); //update css class
Expand Down

0 comments on commit 0e865c2

Please sign in to comment.