@antscorp/antsomi-ui 1.3.5-beta.785 → 1.3.5-beta.786

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.
@@ -7,7 +7,6 @@ import { useDeepCompareMemo } from '@antscorp/antsomi-ui/es/hooks/useDeepCompare
7
7
  import { useDebounce } from '@antscorp/antsomi-ui/es/hooks/useDebounce';
8
8
  import { useUpdateEffect } from '@antscorp/antsomi-ui/es/hooks/useUpdateEffect';
9
9
  import { useDeepCompareEffect } from '@antscorp/antsomi-ui/es/hooks/useDeepCompareEffect';
10
- import { useSettingsTagify } from './hooks';
11
10
  // Components
12
11
  import Tagify from '@yaireo/tagify';
13
12
  // Css
@@ -208,12 +207,30 @@ const TagifyInput = forwardRef((props, ref) => {
208
207
  };
209
208
  }, [initializeTagify]);
210
209
  // Settings some tagify attributes
211
- useSettingsTagify(tagifyRef.current, {
212
- disabled,
213
- readonly,
214
- maxPersonalizeTags,
215
- placeholder,
216
- });
210
+ useLayoutEffect(() => {
211
+ console.log('ref', tagifyRef);
212
+ if (tagifyRef.current && typeof readonly !== 'undefined') {
213
+ tagifyRef.current.setReadonly(!!readonly);
214
+ }
215
+ }, [readonly]);
216
+ // Set disabled
217
+ useLayoutEffect(() => {
218
+ if (tagifyRef.current && typeof disabled !== 'undefined') {
219
+ tagifyRef.current.setDisabled(!!disabled);
220
+ }
221
+ }, [disabled]);
222
+ // Set placeholder
223
+ useLayoutEffect(() => {
224
+ if (tagifyRef.current && typeof placeholder !== 'undefined') {
225
+ tagifyRef.current.setPlaceholder(placeholder);
226
+ }
227
+ }, [placeholder]);
228
+ // Set max personalize tags
229
+ useLayoutEffect(() => {
230
+ if (tagifyRef.current && typeof maxPersonalizeTags !== 'undefined') {
231
+ tagifyRef.current.settings.maxTags = maxPersonalizeTags;
232
+ }
233
+ }, [maxPersonalizeTags]);
217
234
  /*
218
235
  * Need to sync label of the tags if any map attribute is changed to make correct label
219
236
  * */