angular-xeditable
angular-xeditable copied to clipboard
Null value edited then deleted results in empty string
I have a model property with a null value, I then do the following:
- edit it, giving it a value
- save (i.e. click the 'tick' button)
Then I:
- edit it, removing the value
- save (i.e. click the 'tick' button)
The model value is not returned to null, instead it is an empty string. I would expect it to be null.
Worth noting that this problem seems limited to text inputs, number inputs are set to null when empty
i think you can handle it by onbeforesave
event.
if(empty == data){
data = null;
}
Is this still an issue?
@AndrewIsh is this still an issue?
Apologies for the delay in replying. The fix that @zhendong590 suggests obviously works, I guess it's now more a question of whether reverting to an empty string rather than null
is desirable behaviour for angular-xeditable to be doing? My personal feeling is that reverting to null
would be proper behaviour.