The following code is working well to hide a button when a textfield is filled, but it is not working when a datetime widget is encoded:
$form['my_button'] = [
'#type' => 'container',
'submit' => [
'#type' => 'submit',
'#value' => t("Click on me"),
'#submit' => ['submit_me']),
'#states' => [
'visible' => [
':input[data-drupal-selector=selector-of-my-text-field]' => [
'filled' => FALSE,
],
],
],
],
];
Any hint?
['!value' => '']
or['!value' => '(placeholder value)']
? Also stackoverflow.com/a/25295617/295112['value' => '']
(in my above code). If you add the answer, I can grant you the bounty!!!