In the same spirite than #1480568: use $.attr with false instead of empty string I would like to fix states.js to make it compatible with jQuery we have in core *and* more recent version.
I'm explaining the problem with new jquery version in #1498858: [meta] attr and prop.
The corresponding issue on jQuery Update #1448490: fix states.js upstream and remove the overwrite in jQuery Update.
From my first reading of the code I think the problem is in
states.Trigger.states = {
// 'empty' describes the state to be monitored
empty: {
// 'keyup' is the (native DOM) event that we watch for.
'keyup': function () {
// The function associated to that trigger returns the new value for the
// state.
return this.val() == '';
}
},
checked: {
'change': function () {
return this.attr('checked');
}
},
checked.change can certainly return undefined. So we need to return false if we have anythings but true.
So somethings like that (untested)
checked: {
'change': function () {
if(this.attr('checked') === true){
return true;
}else {
return false;
}
}
},