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

RangeControl: Mark positioning is buggy #64481

Closed
jameskoster opened this issue Aug 13, 2024 · 1 comment · Fixed by #64487
Closed

RangeControl: Mark positioning is buggy #64481

jameskoster opened this issue Aug 13, 2024 · 1 comment · Fixed by #64487
Assignees
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@jameskoster
Copy link
Contributor

As can be seen in the screenshot below, or viewing this example in storybook, positioning of marks in the RangeControl component have regressed from the original implementation.

Screenshot 2024-08-13 at 18 08 45

The design may be worth revisiting to align with SpacingSizesControl, but in the short term it would be good to fix this visual bug so that the marks sit neatly on the track, as they did originally.

@jameskoster jameskoster added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components labels Aug 13, 2024
@ramonjd
Copy link
Member

ramonjd commented Aug 14, 2024

Interesting, I can't find any recent changes to the component itself.

This seems to adjust things:

diff --git a/packages/components/src/range-control/styles/range-control-styles.ts b/packages/components/src/range-control/styles/range-control-styles.ts
index 89f4864aee..ec1572d267 100644
--- a/packages/components/src/range-control/styles/range-control-styles.ts
+++ b/packages/components/src/range-control/styles/range-control-styles.ts
@@ -154,7 +154,7 @@ export const Mark = styled.span`
 	height: ${ thumbSize }px;
 	left: 0;
 	position: absolute;
-	top: -4px;
+	top: 9px;
 	width: 1px;
 
 	${ markFill };
@@ -170,7 +170,7 @@ export const MarkLabel = styled.span`
 	color: ${ COLORS.gray[ 300 ] };
 	font-size: 11px;
 	position: absolute;
-	top: 12px;
+	top: 22px;
 	white-space: nowrap;
 
 	${ rtl( { left: 0 } ) };
Screenshot 2024-08-14 at 12 00 09 PM

Does the block editor use marks in range controls anywhere?

I added them to the Cover block opacity controls to check. Seems okay 😄

2024-08-14.12.20.42.mp4

I'll get a small PR if you don't mind double checking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants