From 7ebcca1cd136f336b08d81fa457843d4981beaa2 Mon Sep 17 00:00:00 2001 From: Jan Hassel Date: Mon, 11 Dec 2023 18:36:43 +0100 Subject: [PATCH] fix(column): remove percentage character only if present (#15312) Co-authored-by: Guilherme Datilio Ribeiro --- packages/react/src/components/Grid/Column.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react/src/components/Grid/Column.tsx b/packages/react/src/components/Grid/Column.tsx index ba8657168a59..228878519e5d 100644 --- a/packages/react/src/components/Grid/Column.tsx +++ b/packages/react/src/components/Grid/Column.tsx @@ -366,10 +366,12 @@ function getClassNameForBreakpoints( continue; } - // If our breakpoint is a string, the user has specified a percent + // If our breakpoint is a string, the user might have specified a percent // they'd like this column to span. if (typeof breakpoint === 'string') { - classNames.push(`${prefix}--${name}:col-span-${breakpoint.slice(0, -1)}`); + classNames.push( + `${prefix}--${name}:col-span-${breakpoint.replace('%', '')}` + ); continue; }