Skip to content
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
1 change: 1 addition & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f
- Fixed `Checkbox` from losing focus when quickly toggled ([#717](https://github.com/Shopify/polaris-react/pull/717))
- Fixed the console error in the `PositionedOverlay` test environment ([#758](https://github.com/Shopify/polaris-react/pull/758))
- Fixed `ResourceList` not rendering a header after initial load (thanks to [@andrewpye](https://github.com/andrewpye) for the [original issue](https://github.com/Shopify/polaris-react/issues/735))
- Fixed `TextField` not passing `step` to the input ([#829](https://github.com/Shopify/polaris-react/pull/829))

### Documentation

Expand Down
2 changes: 2 additions & 0 deletions src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export default class TextField extends React.PureComponent<Props, State> {
autoComplete,
min,
max,
step,
minLength,
maxLength,
spellCheck,
Expand Down Expand Up @@ -264,6 +265,7 @@ export default class TextField extends React.PureComponent<Props, State> {
ref: this.setInput,
min,
max,
step,
minLength,
maxLength,
spellCheck,
Expand Down
14 changes: 14 additions & 0 deletions src/components/TextField/tests/TextField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,20 @@ describe('<TextField />', () => {
expect(spy).toHaveBeenCalledWith('1', 'MyTextField');
});

it('passes the step prop to the input', () => {
const element = mountWithAppProvider(
<TextField
id="MyTextField"
label="TextField"
type="number"
step={6}
value="4"
onChange={noop}
/>,
);
expect(element.find('input').prop('step')).toBe(6);
});

it('uses the step prop when incrementing', () => {
const spy = jest.fn();
const element = mountWithAppProvider(
Expand Down