Skip to content

Commit

Permalink
Fixed the status adornment position in ComboBox where it would always…
Browse files Browse the repository at this point in the history
… be vertically centered when the field grows (#3999)
  • Loading branch information
joshwooding authored Aug 19, 2024
1 parent 15ff922 commit 4a1bd04
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-geckos-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@salt-ds/core": patch
---

Fixed the status adornment position in ComboBox where it would always be vertically centered when the field grows.
7 changes: 7 additions & 0 deletions packages/core/src/pill-input/PillInput.css
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@
align-self: flex-start;
}

.saltPillInput-statusAdornmentContainer {
align-self: flex-start;
display: inline-flex;
align-items: center;
height: var(--salt-size-base);
}

.saltPillInput-readOnly .saltPillInput-startAdornmentContainer {
margin-left: var(--salt-spacing-50);
}
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/pill-input/PillInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,9 @@ export const PillInput = forwardRef(function PillInput(
/>
</div>
{!isDisabled && validationStatus && (
<StatusAdornment status={validationStatus} />
<div className={withBaseName("statusAdornmentContainer")}>
<StatusAdornment status={validationStatus} />
</div>
)}
{endAdornment && (
<div className={withBaseName("endAdornmentContainer")}>
Expand Down
15 changes: 15 additions & 0 deletions packages/core/stories/combo-box/combo-box.qa.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,21 @@ export const ClosedExamples: StoryFn<QAContainerProps> = () => (
</ComboBox>
<FormFieldHelperText>This is some help text</FormFieldHelperText>
</FormField>
<FormField>
<FormFieldLabel>Success Multiselect example</FormFieldLabel>
<ComboBox
validationStatus="success"
multiselect
defaultSelected={first5States}
>
{first5States.map((state) => (
<Option value={state} key={state}>
{state}
</Option>
))}
</ComboBox>
<FormFieldHelperText>This is some help text</FormFieldHelperText>
</FormField>
</QAContainer>
);

Expand Down

0 comments on commit 4a1bd04

Please sign in to comment.