Skip to content

Commit

Permalink
fix: fix toggle button text wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ccloli committed Aug 6, 2024
1 parent d0c7262 commit 4dbf358
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/designer/src/toolbar/route-switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ function PageSelect({ value, onSelect, onRemove, onUpdate, onCopy, options }: Pa
<ToggleButton
shape="ghost"
minWidth={100}
maxWidth={200}
textAlign="left"
dropdownProps={{
open: visible,
onOpenChange: setVisible,
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/src/toggle-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const buttonStyle = css`
cursor: pointer;
color: var(--tango-colors-gray-50);
padding: 0 8px;
white-space: nowrap;
.anticon-down {
width: 10px;
Expand Down Expand Up @@ -201,7 +202,8 @@ export function ToggleButton(props: ToggleButtonProps) {

let btn = (
<Button css={buttonStyle} className={clazz} type="button" {...rest}>
<Box as="span">
{/* @ts-ignore textOverflow is available */}
<Box as="span" flex="1" overflow="hidden" textOverflow="ellipsis">
{icon && (
<Box as="span" className="buttonIcon" mr="s">
{icon}
Expand Down

0 comments on commit 4dbf358

Please sign in to comment.