Update library name validation to trim automatically

This commit is contained in:
Bill Thornton
2025-02-20 17:16:18 -05:00
parent 1c2d7ef918
commit 37d6f94c7c
2 changed files with 3 additions and 3 deletions
@@ -42,10 +42,10 @@ function onAddLibrary(e) {
isCreating = true;
loading.show();
const dlg = dom.parentWithClass(this, 'dlg-librarycreator');
const name = dlg.querySelector('#txtValue').value;
const name = dlg.querySelector('#txtValue').value.trim();
let type = dlg.querySelector('#selectCollectionType').value;
if (name.length == 0 || name.trim().length !== name.length) {
if (name.length === 0) {
alert({
text: globalize.translate('LibraryNameInvalid'),
type: 'error'