Skip to content

Commit

Permalink
fix: Make popover white-space style deterministic (#3047)
Browse files Browse the repository at this point in the history
  • Loading branch information
jperals authored Nov 26, 2024
1 parent f545a80 commit 6605b1c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/copy-to-clipboard/internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function InternalCopyToClipboard({
const isInline = variant === 'inline';
const trigger = (
<InternalPopover
className={clsx(isInline && styles['inline-trigger'])}
isInline={isInline}
size="medium"
position="top"
triggerType="custom"
Expand Down
4 changes: 0 additions & 4 deletions src/copy-to-clipboard/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,3 @@
margin-inline-end: awsui.$space-scaled-xxs;
}
}

.inline-trigger {
white-space: nowrap;
}
3 changes: 0 additions & 3 deletions src/internal/styles/utils/styles-reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@
direction: inherit;
empty-cells: show;
font-family: serif;
font-size: medium;
font-style: normal;
font-variant: normal;
font-weight: 400;
font-stretch: normal;
line-height: normal;
hyphens: none;
letter-spacing: normal;
list-style: disc outside none;
Expand Down
6 changes: 5 additions & 1 deletion src/popover/internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface InternalPopoverProps extends Omit<PopoverProps, 'triggerType' |
triggerType?: PopoverProps.TriggerType | 'filtering-token';
size: PopoverProps.Size | 'content';
__closeAnalyticsAction?: string;
isInline?: boolean;
}

export interface InternalPopoverRef {
Expand All @@ -51,11 +52,13 @@ function InternalPopover(
triggerAriaLabel,

wrapTriggerText = true,
isInline = false,
renderWithPortal = false,

__onOpen,
__internalRootRef = null,
__closeAnalyticsAction,

...restProps
}: InternalPopoverProps,
ref: React.Ref<InternalPopoverRef>
Expand Down Expand Up @@ -186,7 +189,8 @@ function InternalPopover(
className={clsx(
styles.root,
baseProps.className,
triggerType === 'filtering-token' && styles['root-filtering-token']
triggerType === 'filtering-token' && styles['root-filtering-token'],
isInline && styles['no-wrap']
)}
ref={mergedRef}
onMouseDown={() => {
Expand Down
3 changes: 3 additions & 0 deletions src/popover/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
.root {
@include styles.styles-reset;
color: inherit;
&.no-wrap {
white-space: nowrap;
}
}

.root-filtering-token {
Expand Down

0 comments on commit 6605b1c

Please sign in to comment.