Skip to content

Commit

Permalink
Fix global namespaces dropdown loading styles
Browse files Browse the repository at this point in the history
With the move to Carbon 11 the ComboBox and Dropdown skeleton states
have changes, and the component props are slightly different.

Remove the obsolete `inline` prop, and update the styles to account
for the updated components to prevent the loading styles overflowing
the header and causing a layout shift on other pages too.
  • Loading branch information
AlanGreene authored and tekton-robot committed Sep 23, 2024
1 parent 5ad571d commit e78e1b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ const TooltipDropdown = ({
disabled,
emptyText,
id,
inline,
items = defaults.items,
label,
loading = false,
onChange,
selectedItem,
size = 'md',
titleText,
...rest
}) => {
Expand All @@ -55,9 +55,9 @@ const TooltipDropdown = ({
<span className={`${carbonPrefix}--label`}>{titleText}</span>
)}
<DropdownSkeleton
className={`${carbonPrefix}--combo-box ${className || ''}`}
className={`${carbonPrefix}--combo-box ${carbonPrefix}--list-box ${carbonPrefix}--list-box--${size} ${className || ''}`}
hideLabel
id={id}
inline={inline}
/>
</div>
);
Expand Down Expand Up @@ -87,13 +87,13 @@ const TooltipDropdown = ({
}
})}
id={id}
inline={inline}
items={options}
itemToString={itemToString}
key={key}
onChange={onChange}
placeholder={options.length === 0 ? emptyString : label}
selectedItem={selectedItem}
size={size}
titleText={titleText}
translateWithId={getTranslateWithId(intl)}
{...rest}
Expand Down
4 changes: 4 additions & 0 deletions src/scss/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ body {
margin-inline-start: 16rem;
}

.#{$prefix}--header .#{$prefix}--list-box__wrapper:has(.#{$prefix}--list-box.#{$prefix}--skeleton) {
inline-size: 245px;
}

.#{$prefix}--modal-header,
.#{$prefix}--modal-content {
inline-size: 100%;
Expand Down

0 comments on commit e78e1b8

Please sign in to comment.