Skip to content

Commit

Permalink
fix: button text wrapping (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemcd authored Nov 8, 2024
1 parent eb5c8f0 commit fe1a1fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-zebras-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@telegraph/button": patch
---

fix button text wrapping
8 changes: 6 additions & 2 deletions packages/button/src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const Text = <T extends TgphElement>({
color,
size,
weight = "medium",
className,
style,
...props
}: TextProps<T>) => {
const context = React.useContext(ButtonContext);
Expand All @@ -249,10 +249,14 @@ const Text = <T extends TgphElement>({
color={derivedColor}
size={size ?? textSizeMap[context.size]}
weight={weight}
className={clsx("no-underline whitespace-nowrap", className)}
internal_optionalAs={true}
data-button-text
data-button-text-color={derivedColor}
style={{
textDecoration: "none",
whiteSpace: "nowrap",
...style,
}}
{...props}
/>
);
Expand Down

0 comments on commit fe1a1fb

Please sign in to comment.