Opened 3 months ago
Last modified 2 months ago
#52157 new defect (bug)
Sidebar widget not partial refreshing for first widget add and remove
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | major | Version: | 5.6 |
Component: | Customize | Keywords: | 2nd-opinion |
Focuses: | ui, performance | Cc: |
Description
When you add the first widget in the sidebar it's a refreshing customizer completely and not partial refreshing.
- Go to Customizer
- Go to the Widgets panel.
- Remove all the widgets one by one.
- At the last widget when you remove it, it refreshes the customizer.
- When adding the first widget it again refreshes the customizer.
First onward, it partially refreshing the customizer as expected.
Please find the attached video for further reference: https://a.cl.ly/WnulD9r6
I need to programmatically add the widget to the dynamic sidebar but as it is refreshing the customizer when adding the first widget to the sidebar I can not proceed with my custom CSS logic.
Please check and let me know if you need anything else.
Change History (2)
Note: See
TracTickets for help on using
tickets.
This is probably because the theme (Twenty Twenty-one) will not display the container that widgets appear in when there are zero widgets. Partial refresh requires that container to exist in order to work and so it falls back to a full refresh.
I don't think there's anything we can do here. Partial refresh is only designed to be best effort and we definitely want to encourage themes to not render empty containers.
Adding
2nd-opinion
to double check my thinking here.