@rhc-shared-components/rich-text-editor 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -219,7 +219,9 @@ var RichTextEditorFormComponent = function RichTextEditorFormComponent(_ref) {
219
219
  setNoOfCharacters = _React$useState[1];
220
220
 
221
221
  React__namespace.useEffect(function () {
222
- setNoOfCharacters(value && value.length && maxLength ? maxLength - value.length : 0);
222
+ if (maxLength) {
223
+ setNoOfCharacters(value && value.length ? maxLength - value.length : maxLength);
224
+ }
223
225
  }, [value, maxLength]);
224
226
  return React__namespace.createElement(FormGroupContainer, {
225
227
  validated: meta.error ? reactCore.ValidatedOptions.error : reactCore.ValidatedOptions["default"],
@@ -197,7 +197,9 @@ const RichTextEditorFormComponent = _ref => {
197
197
  } = useFormikContext();
198
198
  const [numberOfCharacters, setNoOfCharacters] = React.useState(maxLength || 0);
199
199
  React.useEffect(() => {
200
- setNoOfCharacters(value && value.length && maxLength ? maxLength - value.length : 0);
200
+ if (maxLength) {
201
+ setNoOfCharacters(value && value.length ? maxLength - value.length : maxLength);
202
+ }
201
203
  }, [value, maxLength]);
202
204
  return React.createElement(FormGroupContainer, {
203
205
  validated: meta.error ? ValidatedOptions.error : ValidatedOptions.default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhc-shared-components/rich-text-editor",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "WYSWYG Editor for Red Hat Certified Apps",
5
5
  "author": "gautamkrishnar",
6
6
  "license": "MIT",