Yeah this is tricky. I suppose most plugins don’t run into this because their ‘default’ for the category setting is a null value.
Did you have an idea for a core API change which could help improve the situation?
Totally untested, but I think we might be able to swing something right now by using a raw HTML input field (note lowercase input instead of Ember’s two-way-bound <Input component).
<input
value={{or category.custom_fields.my_field "default value"}}
{{on "change" this.updateMyFieldValue}}
/>
With that strategy, we have control over how values are read/written to the model instance. So, if a value is set to the default in the UI, we can write that as ‘null’ in the custom fields:
@action
updateMyFieldValue(event){
let newValue = event.target.value;
if(newValue === "default value"){
newValue = null;
}
this.category.set("custom_fields.my_field", newValue);
}
(and then you would remove the default value configuration you described in (1) of the OP)