Polaris-react: [TextField] Max and Min have the wrong type

Created on 19 Aug 2019  路  2Comments  路  Source: Shopify/polaris-react

Issue summary

min and max should allow for number|string, not just number.

This prevents using min and max for a native date input, which is allowed.

Good first issue 馃悰Bug

Most helpful comment

React types JSX.IntrinsicElements['input']['max'] (and min) as number|string. I don't think we should try and be too clever here, and keep it as simple as possible by allowing number|string.

All 2 comments

React types JSX.IntrinsicElements['input']['max'] (and min) as number|string. I don't think we should try and be too clever here, and keep it as simple as possible by allowing number|string.

I鈥檓 going to reframe this issue as a bug fix instead of a feature request. And to build off of @BPScott鈥檚 point, I think we want to type as number|string, simply pass the string value through to the input, and let the native element handle it accordingly.

Was this page helpful?
0 / 5 - 0 ratings