When trying to add a counter for the text area using count min functionality (i.e "%d characters/word(s) entered"), you cannot save the element without filling in Count max, which will end up using count max functionality, not min
Based on the snippet below, the intended behavior is correct, but there's another validation done in validateConfigurationForm which doesn't check for counter_minimum. Attaching a patch.
$form['validation']['counter_container']['counter_maximum'] = [
'#type' => 'number',
'#title' => $this->t('Count maximum'),
'#min' => 1,
'#states' => [
'required' => [
':input[name="properties[counter_type]"]' => ['!value' => ''],
':input[name="properties[counter_minimum]"]' => ['value' => ''],
],
],
];
Comments
Comment #2
dragos-dumi commentedComment #3
dragos-dumi commentedComment #5
jrockowitz commentedGood catch! Thanks for the patch.
Comment #6
jrockowitz commented