diff --git a/UNRELEASED.md b/UNRELEASED.md index 8714b094dac..29e7350ad1b 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -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 diff --git a/src/components/TextField/TextField.tsx b/src/components/TextField/TextField.tsx index f61ab34578b..38df6c1323c 100644 --- a/src/components/TextField/TextField.tsx +++ b/src/components/TextField/TextField.tsx @@ -168,6 +168,7 @@ export default class TextField extends React.PureComponent { autoComplete, min, max, + step, minLength, maxLength, spellCheck, @@ -264,6 +265,7 @@ export default class TextField extends React.PureComponent { ref: this.setInput, min, max, + step, minLength, maxLength, spellCheck, diff --git a/src/components/TextField/tests/TextField.test.tsx b/src/components/TextField/tests/TextField.test.tsx index b74b0e965bc..bc2d1b10312 100644 --- a/src/components/TextField/tests/TextField.test.tsx +++ b/src/components/TextField/tests/TextField.test.tsx @@ -369,6 +369,20 @@ describe('', () => { expect(spy).toHaveBeenCalledWith('1', 'MyTextField'); }); + it('passes the step prop to the input', () => { + const element = mountWithAppProvider( + , + ); + expect(element.find('input').prop('step')).toBe(6); + }); + it('uses the step prop when incrementing', () => { const spy = jest.fn(); const element = mountWithAppProvider(