When the type="number" prop is present on the TextField component, the readOnly prop does not disable or remove the number steppers. The user can still click the up/down arrows to change the field's value.
Similar to how disabled fields are treated when type="number", remove the number steppers to prevent the value from being changed.
The user can click the up/down arrows (the number steppers) to change the field value, despite the readOnly prop being present.
type="number" propreadOnly propCheck out this Codesandbox project
👋 Thanks for opening your first issue. A contributor should give feedback soon. If you haven’t already, please check out the contributing guidelines. You can also join #polaris on the Shopify Partners Slack.
Hi @matt-neill, removing the onChange prop on the readOnly TextField prevents the steppers from incrementing/decrementing, but they still aren't disabled as I'd expect them to be in a readOnly number component. Thanks for raising this!!
Can I work on this one?
@cloneali Absolutely! Go ahead and assign yourself to the issue so no one doubles up on fixing it, and ping me on the PR when you're ready for review 😃
Cool. Can you assign me this issue? As I am not a member or collaborator in this project. Thanks.
Ahh right looks like it's not possible to actually assign this to you, but it's clear from the comments that you're taking it on, so there shouldn't be anyone doubling up 👍