jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

Firefox accepts non-number characters for fields with {type: "number"}

Open mirismaili opened this issue 2 years ago • 1 comments

Describe the bug

Firefox accepts non-number characters for fields with {type: "number"} and JsonForms doesn't update corresponding data and even remove the corresponding key (count in the below example) in a such case

So there is no validation by AJV.

Expected behavior

The best behavior is to make Firefox doesn't accept invalid characters. But if it's not possible, JsonForms shouldn't remove the corresponding key from data

Steps to reproduce the issue

  1. Open Firefox
  2. Go to the playground
  3. Set Schema to:
    {
      "type": "object",
      "properties": {
        "name": {
          "type": "number"
        }
      }
    }
    
  4. Set UI-Schema to false and Data to {}

Screenshots

image

In which browser are you experiencing the issue?

Firefox v94.0.1 (64-bit)

Framework

No response

RendererSet

No response

Additional context

No response

mirismaili avatar Feb 14 '22 10:02 mirismaili

Hi @mirismaili,

I agree, it would be nicer if the value would be unchanged and even better when invalid values can't even be entered. Do you want to do a contribution for this?

sdirix avatar Feb 28 '22 21:02 sdirix