codecombat / treema

jQuery plugin that generates HTML interfaces to edit JSON data defined by json-schema.
http://codecombat.github.io/treema/
MIT License
152 stars 36 forks source link

Make it easier to leave defaults defaulted after having merely selected a field #43

Open nwinter opened 9 years ago

nwinter commented 9 years ago

With the new defaults, we often end up with a situation like this:

screenshot 2014-09-16 11 15 43

If I press tab or enter in order to save my edit by navigating away from the field, then I get this:

screenshot 2014-09-16 11 16 36

Now there's nothing I can do to avoid the maxAcceleration becoming set to 100 instead of being left as a default of 100:

screenshot 2014-09-16 11 17 29

After which I have to click on the field name (not value) and hit "delete" to restore it to default state. The only other workaround is to deselect the field by clicking with the mouse.

The result is that we get a lot of accidentally overwritten defaults.

What if instead we don't assign the values of fields if they are the same as the default? Or if we only do so when pressing enter, not tab?