@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 +3 -1
- package/dist/index.modern.js +3 -1
- package/package.json +1 -1
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
|
-
|
|
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"],
|
package/dist/index.modern.js
CHANGED
|
@@ -197,7 +197,9 @@ const RichTextEditorFormComponent = _ref => {
|
|
|
197
197
|
} = useFormikContext();
|
|
198
198
|
const [numberOfCharacters, setNoOfCharacters] = React.useState(maxLength || 0);
|
|
199
199
|
React.useEffect(() => {
|
|
200
|
-
|
|
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,
|