Skip to content

number widget saving as string with valueType int #2007

@zanona

Description

@zanona

Describe the bug

I have a field set to the number widget where it's taking an initially set integer value but saving it as a string.

To Reproduce

config.yml

collections:
  - name: product
    label: Products
    extension: yml
    format: yml
    fields:
      - name: price
        label: price
        widget: number
        valueType: int
        default: 0

document.yml

price: 264

After changing the product price to 265 through Netlify CMS, the updated document looks like:

price: '265'

Expected behavior

Save output as integer

Applicable Versions:

https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions