@axinom/mosaic-ui 0.50.0-rc.8 → 0.50.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axinom/mosaic-ui",
3
- "version": "0.50.0-rc.8",
3
+ "version": "0.50.0",
4
4
  "description": "UI components for building Axinom Mosaic applications",
5
5
  "author": "Axinom",
6
6
  "license": "PROPRIETARY",
@@ -32,7 +32,7 @@
32
32
  "build-storybook": "storybook build"
33
33
  },
34
34
  "dependencies": {
35
- "@axinom/mosaic-core": "^0.4.23-rc.8",
35
+ "@axinom/mosaic-core": "^0.4.23",
36
36
  "@faker-js/faker": "^7.4.0",
37
37
  "@popperjs/core": "^2.11.8",
38
38
  "clsx": "^1.1.0",
@@ -105,5 +105,5 @@
105
105
  "publishConfig": {
106
106
  "access": "public"
107
107
  },
108
- "gitHead": "6f1b1ae0137a2c53cce3316f9d8a2d2b48783ce2"
108
+ "gitHead": "d13814dea6f5683979fe8863dfa8945ad1e3b271"
109
109
  }
@@ -44,6 +44,7 @@ describe('FreeTextFilter', () => {
44
44
  });
45
45
 
46
46
  it('selects text on focus when selectOnFocus is true and there is a value', () => {
47
+ jest.useFakeTimers();
47
48
  const mockValue = 'test value';
48
49
  const spy = jest.fn();
49
50
 
@@ -53,6 +54,9 @@ describe('FreeTextFilter', () => {
53
54
  const input = wrapper.find('input');
54
55
  input.simulate('focus');
55
56
 
57
+ // Fast-forward until all timers have been executed
58
+ jest.runAllTimers();
59
+
56
60
  const inputElement = input.getDOMNode<HTMLInputElement>();
57
61
  expect(inputElement.selectionStart).toBe(0);
58
62
  expect(inputElement.selectionEnd).toBe(mockValue.length);
@@ -37,7 +37,10 @@ export const FreeTextFilter: React.FC<FreeTextFilterProps> = ({
37
37
 
38
38
  const onFocusWrapper = (): void => {
39
39
  if (selectOnFocus && valueLocal) {
40
- inputRef.current?.select();
40
+ // setTimeout ensures inputRef.current is available before selecting, as it may be null if the user hits enter and refocuses.
41
+ setTimeout(() => {
42
+ inputRef.current?.select();
43
+ });
41
44
  }
42
45
  };
43
46
 
@@ -24,6 +24,7 @@ const StoryComponent: React.FC<{ cancel: () => void }> = ({
24
24
  {
25
25
  label: 'Close',
26
26
  icon: IconName.X,
27
+ kind: 'action',
27
28
  onClick: cancel,
28
29
  },
29
30
  ]}