mirror of
https://github.com/nasa/openmct.git
synced 2025-01-18 02:39:56 +00:00
prevents users from using empty strings as names (#2461)
This commit is contained in:
parent
a34ad4e58c
commit
a0864a8702
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user