grommet / grommet/react-formify

getResource changes value of strings with quotes

Open
#11 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
8
Forks
2
PR merge metrics
No merged PRs in 30d

Description

`FormState.js` contains the function:

```
this.getResource = function () {
return JSON.parse(JSON.stringify(_this.obj).replace(/"\s+|\s+"/g, '"'));
};
```

The regex replace can change the value of a form element. For example, if you have a `textarea` with the value `foo "bar" foo` the regex will change it (remove last space) to `foo "bar"foo` which is not the desired string.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.