Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAD-4108 Fix setting numeric padding/margin on submenu links #674

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oakesjosh
Copy link
Contributor

@oakesjosh oakesjosh commented Feb 27, 2025

KAD-4108

This issue is due to CPT needing meta to be stored as a string, we convert the numeric padding values to a string. The padding component sees a string and thinks it's a variable value (SM, MD, LG). I created the arrayStringToInt helper a while back to support converting strings of number back into integers so the component handles them correctly. We use this function in this file and the advanced header.

Choose a reason for hiding this comment

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

PR Overview

This PR fixes an issue with submenu links by ensuring that numeric padding and margin values stored as strings are converted to integers before being used in the ResponsiveMeasureRangeControl component.

  • Convert meta values for padding and margin from strings to integers using arrayStringToInt.
  • Update both padding and margin controls in src/blocks/navigation/edit-inner.js.

Reviewed Changes

File Description
src/blocks/navigation/edit-inner.js Converts stored string meta values to integers for padding and margin controls

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Copy link

github-actions bot commented Feb 27, 2025

🎉 Zip build complete

Build timestamp

Copy link
Contributor

@gilbert-hernandez gilbert-hernandez left a comment

Choose a reason for hiding this comment

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

I tested this and the fix works for me. The custom link padding and margin now lets me update each side without disappearing.

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.

2 participants