- 🇮🇳India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
As per #11 Patch failed to apply because in 10.1x dev this issue is no more present So we can Close the Issue.
If you have a dependent element #states set as such:
'disabled' => array(
':input[name="dependee-field"]' => array('filled' => TRUE)
)
and you right click into the dependee-field and select paste from the contextual menu, the dependee-field is filled with the value but the dependent field(s) are not disabled.
Looking at the file: <drupal root>/misc/states.js
starting on line 365:
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() == '';
}
},
It is clear that the empty check that is used for the keyword "filled" only triggers on the "keyup" event, not mouse actions.
I was able to make a change that works, but is a little weird UI wise.
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() == '';
},
'change': function(){
return this.val() == '';
}
},
This causes the dependent field to be disabled normally when the keyboard is used to enter data into the dependee field. It also causes the dependent field to be disabled on right-click paste, but only once the user clicks out of the field, this is not quite ideal, but does get the intended job done. I am happy to make a patch, but wanted to make sure the slight UI weirdness is acceptable before bothering.
Needs work
10.1 ✨
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
As per #11 Patch failed to apply because in 10.1x dev this issue is no more present So we can Close the Issue.