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

fix: Make popover white-space style deterministic #3047

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that these 3 rules were unnecessary because they are overriden by the typography.default-text-style mixin which is included further down

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
Loading