-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
Description
Description of the bug
When a form field uses states to show/hide itself based on the 'filled' value of a textfield, it doesn't work when you enter text into the textfield using the browser's remembered values in a drop-down.
It's hard to explain so see the video below.
Steps To Reproduce
To reproduce the behavior:
- Create a form with two fields - a textfield and a checkbox
- Use states on the checkbox to show it when the textfield is 'filled'
- Enter text into the textfield to see the checkbox appear
- Save the form
- Retry by selecting the saved form value for the textfield (instead of typing directly)
Actual behavior
Checkbox doesn't appear.
Expected behavior
Checkbox appears.
Additional information
filled_state.mp4
This video uses a form with the following code:
$form['module']['module_configure_path'] = array(
'#type' => 'textfield',
'#title' => t('Configuration page path'),
'#placeholder' => t('admin/config/system/my-module'),
'#indentation' => 1,
);
$form['module']['module_configure_file'] = array(
'#type' => 'checkbox',
'#title' => t('Put page callback in a separate file'),
'#description' => t('The callback function that generates the page at the above configuration path will be placed into a separate `[module_name].admin.inc` file.'),
'#indentation' => 2,
'#states' => array(
'visible' => array(
':input[name="module_config"]' => array('checked' => TRUE),
':input[name="module_configure_path"]' => array('filled' => TRUE),
),
),
);