mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2025-02-27 09:00:36 +03:00
Fixed onChange unexpeted trigger
Checking the value for a checkbox input is not wisely, prefer checking the "checked" attribute, we also need to verify if there is a value in the input because default value (for example a text input) is "" and $(this).attr("value") returns undefined.
This commit is contained in:
parent
bcf137386a
commit
feee0f0be1
|
@ -125,8 +125,8 @@
|
||||||
(function() {
|
(function() {
|
||||||
// This part of code will detect autofill when the page is loading (username and password inputs for example)
|
// This part of code will detect autofill when the page is loading (username and password inputs for example)
|
||||||
var loading = setInterval(function() {
|
var loading = setInterval(function() {
|
||||||
$("input").each(function() {
|
$("input[type!=checkbox]").each(function() {
|
||||||
if ($(this).val() !== $(this).attr("value")) {
|
if ($(this).val() && $(this).val() !== $(this).attr("value")) {
|
||||||
$(this).trigger("change");
|
$(this).trigger("change");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user