Skip to content

Commit

Permalink
V1: check unique for calculated values and matrix column names as cas…
Browse files Browse the repository at this point in the history
…e insensitive fixed #3252 (#3254)
  • Loading branch information
andrewtelnov committed Jul 11, 2022
1 parent 20b8c03 commit 73a3e55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -322,9 +322,13 @@ export class SurveyPropertyEditorBase implements Survey.ILocalizableOwner {
!Array.isArray(this.parentList)
)
return false;
const val = this.koValue();
for (var i = 0; i < this.parentList.length; i++) {
if (this.parentList[i] === this.object) continue;
if (this.parentList[i][this.property.name] == this.koValue()) return true;
const propVal = this.parentList[i][this.property.name];
if(typeof propVal === "string" && typeof val === "string"
&& propVal.toLocaleLowerCase() === val.toLocaleLowerCase()) return true;
if (propVal == this.koValue()) return true;
}
return false;
}
Expand Down
Expand Up @@ -1560,6 +1560,8 @@ QUnit.test("editor base check for unique property value", function (assert) {
assert.equal(textEditor.hasError(), false, "name is unique #2");
textEditor.koValue("column4");
assert.equal(textEditor.hasError(), false, "name is unique #3");
textEditor.koValue("Column3");
assert.equal(textEditor.hasError(), true, "name is unique #4");
});

QUnit.test(
Expand Down

0 comments on commit 73a3e55

Please sign in to comment.