Skip to content

Commit 8af3bd2

Browse files
author
Luke Bowerman
authored
InputText + theme.reset fix (#1158)
1 parent bb51e8b commit 8af3bd2

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
- `DialogContent` with `borderBottom` prop CSS output error (no border, no flex: 8)
1717
- `Dialog` focus not returning to trigger when closed
18+
- `InputText` interacts poorly with `theme.reset` property in narrow cases
1819
- `Select` not opening when rendered in a `Dialog` opened from a `Popover`
1920

2021
## [0.9.4] - 2020-06-29

packages/components/src/Form/Inputs/InputText/InputText.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@
2727
import pick from 'lodash/pick'
2828
import omit from 'lodash/omit'
2929
import { IconNames } from '@looker/icons'
30-
import { omitStyledProps, space, SpaceProps } from '@looker/design-tokens'
30+
import {
31+
omitStyledProps,
32+
space,
33+
SpaceProps,
34+
reset,
35+
layout,
36+
} from '@looker/design-tokens'
3137
import React, { forwardRef, MouseEvent, ReactNode, Ref, useRef } from 'react'
3238
import styled, { css } from 'styled-components'
3339
import { InputProps, inputPropKeys, InputTextTypeProps } from '../InputProps'
3440
import { innerInputStyle } from '../innerInputStyle'
35-
import {
36-
SimpleLayoutProps,
37-
simpleLayoutCSS,
38-
} from '../../../Layout/utils/simple'
41+
import { SimpleLayoutProps } from '../../../Layout/utils/simple'
3942
import { Icon } from '../../../Icon'
4043
import { Text } from '../../../Text'
4144
import { useForkedRef, useWrapEvent } from '../../../utils'
@@ -268,14 +271,17 @@ export const inputCSS = css`
268271
`
269272

270273
export const InputText = styled(InputTextLayout)<InputTextProps>`
274+
${reset}
275+
271276
align-items: center;
272277
cursor: text;
273278
display: inline-flex;
274279
justify-content: space-evenly;
275280
padding: ${({ theme: { space } }) => `${space.xxxsmall} ${space.xxsmall}`};
276281
width: ${({ autoResize }) => (autoResize ? 'auto' : '100%')};
277282
278-
${simpleLayoutCSS}
283+
${layout}
284+
${space}
279285
${inputCSS}
280286
281287
${InlineInputTextBase} {

0 commit comments

Comments
 (0)