bpmn-io / form-js

View and visually edit JSON-based forms.
https://bpmn.io/toolkit/form-js/
Other
418 stars 107 forks source link

Default value <none> is serialized as "<none>" in the schema when using preact@10.15.1 #1282

Closed Skaiir closed 1 month ago

Skaiir commented 1 month ago

Describe the Bug

Whenever using more recent versions of preact, the default value is serialized as "" in the schema, we want it to be serialized as no value at all.

Steps to Reproduce

  1. update preact in the lockfile to 10.15.1
  2. create a select component
  3. set default value to none
  4. inspect schema
  5. "\<none>" is serialized

Expected Behavior

  1. nothing should be serialized
Skaiir commented 1 month ago

RCA

The issue stems from the fact that newer versions of preact (correctly) serialize <option value={null}>label</option> to <option>label</option>, which is expected.

For sanity we should update the preact version we test on to 10.15.1 (we can't go further with this because of https://github.com/bpmn-io/form-js/issues/1216). This means changing the lockfile. Also, we need to use value "" instead of null to fix the actual bug.

Skaiir commented 1 month ago

Closed via https://github.com/bpmn-io/form-js/pull/1283