The States API does not execute condition at first display when no default value is setted in field and select field has option #multiple = TRUE or #size.
Steps to reproduce:
- Create two fields in a form with the following code:
$form['dependee'] = array( '#type' => 'select', '#options' => array( 'a' => 'Option A', 'b' => 'Option B', 'c' => 'Option C', ), '#size' => 3, ); $form['dependent'] = array( '#type' => 'textfield', '#states' => array( 'visible' => array( 'select[name="dependee"]' => array('value' => array('a')), ), ), );
I try to fix this adding
$this->reevaluate() at the end of
states.Dependent.prototype.initializeDependee. This works in browser, but writing tests with mink fail.
Tests should be covered byand this issue has been found working on