@danikokonn/yarik-frontend-lib 2.0.58-test22 → 2.0.58-test26

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.
@@ -1 +1 @@
1
- {"version":3,"file":"RichFilterTextField.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/RichFilterTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAUf,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAKlE,QAAA,MAAM,mBAAmB,GAAI,4HAS1B,wBAAwB,sBAwR1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"RichFilterTextField.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/RichFilterTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAUf,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAKlE,QAAA,MAAM,mBAAmB,GAAI,4HAS1B,wBAAwB,sBA+R1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -57,7 +57,8 @@ const RichFilterTextField = ({ filterExpr, filterExprHist, fields, operators, ad
57
57
  }
58
58
  const { newSearch, newPos } = insertInStrPos(search, cursorPos, hint, fields);
59
59
  setSearch(newSearch);
60
- onChange(newSearch);
60
+ if (instant)
61
+ onChange(newSearch);
61
62
  let newCursorPos = newPos;
62
63
  if (hint.includes("[") || hint.includes("(") || hint.includes("/")) {
63
64
  newCursorPos--;
@@ -96,7 +97,12 @@ const RichFilterTextField = ({ filterExpr, filterExprHist, fields, operators, ad
96
97
  break;
97
98
  }
98
99
  default: {
99
- setCursorPos(inputRef.current?.selectionStart ?? null);
100
+ const newCursorPos = inputRef.current?.selectionStart ?? null;
101
+ setCursorPos(newCursorPos);
102
+ if (newCursorPos &&
103
+ getHints(search, newCursorPos, fields, operators) !==
104
+ currentHintOptions)
105
+ setFocusIdx(0);
100
106
  }
101
107
  }
102
108
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danikokonn/yarik-frontend-lib",
3
- "version": "2.0.58-test22",
3
+ "version": "2.0.58-test26",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "author": "",