Spacing presets: fix bug with select control adding undefined preset values#53005
Spacing presets: fix bug with select control adding undefined preset values#53005glendaviesnz merged 3 commits intotrunkfrom
Conversation
…ntrol in getPresetValueFromCustomValueControl
|
@andrewserong just pinging you to double-check that I haven't overlooked any use cases in modifying this function that was introduced in #43466? |
|
Size Change: +23 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
Nope! I think it should just return the value as-is if it's falsy, same as what we're doing with |
Thanks for verifying, I merged all of those checks into one, didn't make sense to keep the undefined one separate. |
andrewserong
left a comment
There was a problem hiding this comment.
Thanks Glen, LGTM, this is testing nicely! ✨
I've just added the backport label as this is fairly similar to a related fix that made it in for 6.3 (#52711), so it'd be good to see if we can get this fix in too, if it isn't too late.
|
I just cherry-picked this PR to the update/packages-wp-6-3-RC3 branch to get it included in the next release: 022f9dc |
* Patterns: Enable focus mode editing (#52427) * PreventDefault when isComposing is true. apply patch from t-hamano. (#52844) see: #52821 (comment) * List View: Ensure onDrop does not fire if there is no target (#52959) * I18N: Add missing Gettext wrapper on strings in Edit Post overview sidebar (#52971) * I18N: Add missing gettext wrapper * Add context to disambiguate 'Outline' that is commonly used on borders. * Footnotes: disable based on post type (#52934) * Footnotes: disable based on post type * Address feedback * Fix typo * Format: disable if block is not registered * Lock usesContext api * Use Symbol instead of Math.random * Patterns Browse Screen: Fix back button when switching between categories (#52964) * Patterns: Allow orphaned template parts to appear in general category (#52961) * Spacing presets: fix bug with select control adding undefined preset values (#53005) * Site Editor: Fix canvas mode sync with URL (#52996) * Check if spacing tool is defined before displaying controls. (#53008) * Check if spacing tool is defined before displaying controls. * Don't show sides if spacing type false * Improve consistency of the Post editor and Site editor Document actions (#52246) * Remove redundant shortcut button. * Fix focus and hover style and improve consistency. * Rename post document-title and improve CSS consistency. * Site Editor: Fix the typo in the title label map (#53071) * Fix patterns search crash: check for existence of defaultView before attempting to get styles (#52956) * backport paging bug fixes (#53091) --------- Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com> Co-authored-by: Hiroshi Urabe <mail@torounit.com> Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Co-authored-by: Pedro Mendonça <ped.gaspar@gmail.com> Co-authored-by: Ella <4710635+ellatrix@users.noreply.github.com> Co-authored-by: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Co-authored-by: Glen Davies <glendaviesnz@users.noreply.github.com> Co-authored-by: tellthemachines <tellthemachines@users.noreply.github.com> Co-authored-by: Andrea Fercia <a.fercia@gmail.com>
What?
Fixes a bug where the select list used if more than 7 preset values adds invalid preset value attributes.
Why?
Fixes: #52976
How?
Accounts for the undefined value set by spacing presets select list control in getPresetValueFromCustomValueControl.
Testing Instructions
settings.spacing.spacingPresetsvalues to 8+Defaultoption in the select listvar:preset|spacing|defaultScreenshots or screencast
Before:
spacing-presets-default.mp4
After:
spacingpresets-after.mp4