Skip to content

Commit

Permalink
add flag to not strip whitespace in primitve field
Browse files Browse the repository at this point in the history
  • Loading branch information
MJedr committed Dec 3, 2021
1 parent 7b0c474 commit b246e2e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng2-json-editor",
"version": "0.25.45",
"version": "0.25.46",
"description": "Angular2 component for editing large json documents",
"keywords": [
"angular2",
Expand Down
2 changes: 1 addition & 1 deletion src/primitive-field/primitive-field.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class PrimitiveFieldComponent extends AbstractFieldComponent implements O
}

onValueChange(value: string) {
this.value = this.schema.stripWhitespace ? value.trim() : value;
this.value = this.schema.omitStripWhitespace ? value : value.trim();
}

onSearchableDropdownSelect(value: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/interfaces/schema-option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ export interface SchemaOption {
/**
* Configuration for striping whitespaces from field value
*/
stripWhitespace?: boolean;
omitStripWhitespace?: boolean;
}

0 comments on commit b246e2e

Please sign in to comment.