Skip to content

Commit

Permalink
fix: Fixes Select and AutoSuggest input heights (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
amir-zahedi authored Jun 28, 2023
1 parent 6527e11 commit fec5365
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .changeset/old-walls-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@autoguru/overdrive': patch
---

Select Input: Get heights aligned with other inputs
AutoSuggest Input: Get heights aligned with other inputs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export const suggestionList = {
}),
};

export const inputPrimitive = style({
marginTop: `calc(-1 * ${vars.border.width['1']})`,
marginBottom: `calc(-1 * ${vars.border.width['1']})`,
});
export const input = style({
position: 'sticky',
top: 0,
Expand Down
23 changes: 12 additions & 11 deletions packages/overdrive/lib/components/AutoSuggest/AutoSuggest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -635,17 +635,17 @@ const SuggestionsList = <PayloadType extends unknown>({

const AutoSuggestInputPrimitive = withEnhancedInput(
({
field,
eventHandlers,
validation,
suffixed,
prefixed,
isLoading,
fieldIcon = ChevronDownIcon,
isFocused,
className,
size,
...rest
field: { className: fieldClassName, ...field },
eventHandlers,
validation,
suffixed,
prefixed,
isLoading,
fieldIcon = ChevronDownIcon,
isFocused,
className,
size,
...rest
}) => {
let focusTimeout;
const ref = useRef<HTMLInputElement>(null);
Expand Down Expand Up @@ -717,6 +717,7 @@ const AutoSuggestInputPrimitive = withEnhancedInput(
autoCapitalize="none"
spellCheck="false"
autoComplete="off"
className={[fieldClassName, styles.inputPrimitive]}
{...rest}
type="search"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { style } from '@vanilla-extract/css';

import { themeContractVars as vars } from '../../themes/theme.css';

export const input = style({});
export const input = style({
marginTop: `calc(-1 * ${vars.border.width['1']})`,
marginBottom: `calc(-1 * ${vars.border.width['1']})`,
});
export const paddedInput = style({
selectors: {
[`${input}&`]: {
Expand Down

0 comments on commit fec5365

Please sign in to comment.