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
{{ message }}
Repository navigation
TimePicker: Layout breaks when the timezone string is long #56257
CSS StylingRelated to editor and front end styles, CSS-specific issues.[Package] Components/packages/components[Type] BugAn existing feature does not function as intended
The TimePicker renders a Spacer component between the AM/PM buttons and the timezone indication.
I would argue that a component should not render a Spacer, which is a presentational component. Presentation should be kept separate from funcitonality.
Anyways, when the timezone indication is a little longer than usual, e.g. UTC+5.75, th elayout breaks and the AM/PM buttons get stacked vertically. Note: the displayed value 5.75 is wrong. I created #56254 to address that.
Screenshot:
Step-by-step reproduction instructions
Go to the WordPress admin Settings > General Settings > Timezone.
Set the Timezone value to UTC+5:45 and save.
Go to the post editor and publish a new post.
Click the Publish date in the settings panel.
The Publish popover appears.
Observe the AM/PM buttons leyout is broken.
Observe there is enough space to display the longer timezone value but the layout breaks regardless.
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
What is the desired layout tweak here? We could for example flex-wrap it so it goes to the next line when the width is too narrow.
But if the max possible length of the timezone string is not that long, it's more about tweaking the width of whatever container the consumer is putting TimePicker in. (TimePicker itself does not have width constraints.)
But if the max possible length of the timezone string is not that long, it's more about tweaking the width of whatever container the consumer is putting
Yes, the timezone string can contain max 2 numbers (minutes) after a colon. I think it's more about removing the spacer between AM/PM and the timezone. That spacer is unnecessary and it's responsible for the breakage. For example, the timezone could use a left margin auto to be right aligned and the spacer be entirely removed.
I checked this on WP 7.1.2 with Gutenberg trunk (late July 2026) with the timezone set to UTC+5:45 (and UTC-9:30). The AM/PM buttons and the timezone label stay on a single row in the Publish popover. As noted earlier, #56196 fixed the layout breakage. The remaining idea (dropping the Spacer) is a code-quality tweak rather than a bug, so I'm closing this one.
CSS StylingRelated to editor and front end styles, CSS-specific issues.[Package] Components/packages/components[Type] BugAn existing feature does not function as intended
Activity
afercia commentedon Nov 17, 2023
Noting that this can't be reproduced any longer after #56196
But: I think the changes from #56196 should be adjusted a bit, so I'd keep this open for now.
mirka commentedon Dec 15, 2023
What is the desired layout tweak here? We could for example flex-wrap it so it goes to the next line when the width is too narrow.
But if the max possible length of the timezone string is not that long, it's more about tweaking the width of whatever container the consumer is putting
TimePickerin. (TimePickeritself does not have width constraints.)afercia commentedon Dec 21, 2023
Yes, the timezone string can contain max 2 numbers (minutes) after a colon. I think it's more about removing the spacer between AM/PM and the timezone. That spacer is unnecessary and it's responsible for the breakage. For example, the timezone could use a left margin
autoto be right aligned and the spacer be entirely removed.youknowriad commentedon Oct 7, 2026
I checked this on WP 7.1.2 with Gutenberg trunk (late July 2026) with the timezone set to UTC+5:45 (and UTC-9:30). The AM/PM buttons and the timezone label stay on a single row in the Publish popover. As noted earlier, #56196 fixed the layout breakage. The remaining idea (dropping the Spacer) is a code-quality tweak rather than a bug, so I'm closing this one.