@antscorp/antsomi-ui 1.3.5-beta.870 → 1.3.5-beta.871

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.
@@ -757,10 +757,6 @@ const TagifyInput = forwardRef((props, ref) => {
757
757
  makeValidLabelTags(mapAttributes, mapErrorAttributes);
758
758
  }
759
759
  }
760
- else if (!classList.contains(empty) && initialValue === '') {
761
- // Removes all tags and resets the original input tag's value property if the initial value back to is empty string
762
- tagifyRef.current.removeAllTags();
763
- }
764
760
  }
765
761
  }, [
766
762
  initialValue,
@@ -770,6 +766,17 @@ const TagifyInput = forwardRef((props, ref) => {
770
766
  acceptableTagPattern,
771
767
  makeValidLabelTags,
772
768
  ]);
769
+ useEffect(() => {
770
+ if (tagifyRef.current && initialValue === '') {
771
+ const { DOM, settings } = tagifyRef.current;
772
+ const { empty } = settings.classNames;
773
+ const { classList } = DOM?.scope;
774
+ if (!classList.contains(empty)) {
775
+ // Removes all tags and resets the original input tag's value property if the initial value back to is empty string
776
+ tagifyRef.current.removeAllTags();
777
+ }
778
+ }
779
+ }, [initialValue]);
773
780
  useEffect(() => {
774
781
  const tagifyTooltip = document.querySelector('.tagify__tooltip');
775
782
  if (!tagifyTooltip) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.870",
3
+ "version": "1.3.5-beta.871",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",