You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Description of the bug
When a select field using both
type_ahead
anddisplay_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 ondisable_block_terms
isn't initialized on the next pageload after uncheckingdisable_blocks
:Additional Information
Adding
fm_displayif_toggle
to this list seems to fix the problem:wordpress-fieldmanager/php/class-fieldmanager-select.php
Line 193 in 584979f
The text was updated successfully, but these errors were encountered: