-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Labels
bugSomething isn't workingSomething isn't workingjavascriptRequires understanding JavaScriptRequires understanding JavaScript
Description
Description of the bug
When a select field using both type_ahead and display_if is initially hidden, chosen.js isn't initialized when the field is shown.
Steps To Reproduce
Test with this group by saving it with disable_blocks enabled, and you should see that the typeahead UI on disable_block_terms isn't initialized on the next pageload after unchecking disable_blocks:
new Fieldmanager_Group(
[
'label' => 'Ads',
'children' => [
'disable_blocks' => new \Fieldmanager_Checkbox( 'Disable all blocks' ),
'disable_block_terms' => new Fieldmanager_Select(
[
'label' => 'Disable blocks on these categories',
'datasource' => new Fieldmanager_Datasource_Term(
[
'taxonomy' => 'category',
],
),
'display_if' => [
'src' => 'disable_blocks',
'value' => '0',
],
'multiple' => true,
'type_ahead' => true,
],
),
],
]
)
Additional Information
Adding fm_displayif_toggle to this list seems to fix the problem:
| $('.fm-wrapper').on("fm_added_element fm_collapsible_toggle fm_activate_tab",".fm-item",function(){ |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingjavascriptRequires understanding JavaScriptRequires understanding JavaScript