Skip to content

Conversation

@jamesros161
Copy link
Contributor

This resolves #156 by ensuring that loadSection() runs every time 'boldgrid_customizer_refresh' event fires.

@jamesros161 jamesros161 requested a review from rramo012 March 18, 2020 17:35
@rramo012
Copy link
Member

rramo012 commented Mar 23, 2020

  1. Load section is supposed to be run once when the customizer loads. It shouldn't be run each time a preview refresh is triggered by a control. Moving the function call into init will bind the expanded event repeatedly. This causes duplicate function calls on a single event; one binding for every refresh triggered by a control.

  2. The fix you implemented did not resolve the issue for me. You can replicate by...

    • set the background image
    • Reloading the customizer
    • Insert a widget
    • open the background panel
  3. By removing the previous fix, this issue breaks: Crio - Uploading an Image Background flips Customizer to Pattern & Color panel  #140

  4. Most likely unrelated to this ticket but can you verify that background patterns are working? If not, can you create a new ticket for it?

My recommendation would be reverting to the previous code. Then add the following to the background_image expanded callback. This should handle the refresh cases when the panel is focused immediately, and when the panel is not focused the update would be done upon opening the background image panel.

api.section( 'background_image' ).expanded.bind( expanded => {
    if ( expanded ) {
        updateBgType( api( 'boldgrid_background_type' )() );
        validateSelectionSet();
    }

Copy link
Member

@rramo012 rramo012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs changes

@rramo012 rramo012 merged commit ddda91e into master Mar 23, 2020
@rramo012 rramo012 deleted the crio-156 branch March 23, 2020 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

widget partial refresh causes background image tabs to display all options

3 participants