prevents users from using empty strings as names (#2461)

This commit is contained in:
Deep Tailor 2019-08-29 20:31:52 -07:00 committed by Andrew Henry
parent a34ad4e58c
commit a0864a8702

View File

@ -77,9 +77,10 @@ const PLACEHOLDER_OBJECT = {};
this.showSaveMenu = false;
},
updateName(event) {
// TODO: handle isssues with contenteditable text escaping.
if (event.target.innerText !== this.domainObject.name) {
if (event.target.innerText !== this.domainObject.name && event.target.innerText.match(/\S/)) {
this.openmct.objects.mutate(this.domainObject, 'name', event.target.innerText);
} else {
event.target.innerText = this.domainObject.name;
}
},
updateNameOnEnterKeyPress (event) {