Opened 4 weeks ago
Last modified 3 weeks ago
#63465 new defect (bug)
Events and News Widget: Empty <ul> Appears Without City Selection Causing Layout Shift
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.3 |
Component: | Widgets | Keywords: | has-screenshots has-patch needs-testing |
Focuses: | ui, css, administration | Cc: |
Description
When no city is selected in the WordPress Dashboard's "Events and News" widget, an empty <ul> element is still rendered. This causes an unnecessary blank space, resulting in a two-line display where only one is expected. Ideally, the <ul> should not be rendered unless actual event content exists.
Attachments (4)
Change History (8)
This ticket was mentioned in PR #8821 on WordPress/wordpress-develop by @dvpatel.
4 weeks ago
#2
Reduce margin to remove extra space in Events and News widget
Instead of removing the empty <ul>
, this approach reduces the bottom margin, ensuring that the widget maintains a clean, single-line display without affecting layout when events are present.
Trac ticket: https://core.trac.wordpress.org/ticket/63465
#4
@
3 weeks ago
- Focuses ui-copy removed
- Version changed from trunk to 6.3
The 6px
bottom margin was added in [55889] for the Activity widget, but it also appears for the first .activity-block
element in the Events and News widget. That changeset also assigned a zero margin for the :last-child
.
If those two changes should be undone, the Activity widget spacing could still work with a rule like this:
#activity-widget .activity-block + .activity-block { margin-top: 6px; }
In my site, I did not have an empty ul
, however. The events list included an event-none
list item with "There are no events scheduled near you at the moment. Would you like to organize a WordPress event?"
Created patch.