ramp4-pcar4 / config-editor

A config editor for RAMP4.
1 stars 1 forks source link

Deleting a number field changes the value to an empty string #17

Open mohsin-r opened 8 months ago

mohsin-r commented 8 months ago

Let's say the user sets expectedLoadTime to 4000. Then they decide they don't want this property in the config and then clear the input field.

This results in expectedLoadTime being set to '' i.e. the empty string. This would be pretty disrespectful and a RAMP instance initialized with such a property would likely have errors.

This happens because of how Vue's v-model works under the hood. People have already attempted to grouse but to no avail.

This is a pretty significant problem because it is currently affecting all numeric properties in the config. One solution (thank you @milespetrov for the suggestion) is to code a custom directive and use the logic for all numeric fields.