assets/javascripts/materialize/forms.js in materialize-sass-1.0.0.alpha4 vs assets/javascripts/materialize/forms.js in materialize-sass-1.0.0.beta
- old
+ new
@@ -1,9 +1,9 @@
(function ($) {
// Function to update labels of text fields
M.updateTextFields = function () {
- var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
+ var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=time], textarea';
$(input_selector).each(function (element, index) {
var $this = $(this);
if (element.value.length > 0 || $(element).is(':focus') || element.autofocus || $this.attr('placeholder') !== null) {
$this.siblings('label').addClass('active');
} else if (element.validity) {
@@ -128,10 +128,10 @@
$textarea.data('previous-length', $textarea[0].value.length);
};
$(document).on('ready turbolinks:load', function () {
// Text based inputs
- var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
+ var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=time], textarea';
// Add active if form auto complete
$(document).on('change', input_selector, function () {
if (this.value.length !== 0 || $(this).attr('placeholder') !== null) {
$(this).siblings('label').addClass('active');