@snack-uikit/fields 0.17.8 → 0.17.9
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 0.17.9 (2024-03-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **FF-0000:** tag deletion cross click handling ([eed7b9b](https://github.com/cloud-ru-tech/snack-uikit/commit/eed7b9b9afab3b77a60ecca3d742d02cdc8c81f3))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 0.17.8 (2024-03-12)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyboardEvent, KeyboardEventHandler, RefObject } from 'react';
|
|
1
|
+
import { KeyboardEvent, KeyboardEventHandler, MouseEvent, RefObject } from 'react';
|
|
2
2
|
import { Handler } from 'uncontrollable';
|
|
3
3
|
import { ItemWithId, SearchState } from './types';
|
|
4
4
|
type UseHandleOnKeyDownProps = {
|
|
@@ -26,5 +26,5 @@ export declare function useSearchInput({ value, onChange, defaultValue }: Search
|
|
|
26
26
|
onInputValueChange: Handler;
|
|
27
27
|
prevInputValue: import("react").MutableRefObject<string>;
|
|
28
28
|
};
|
|
29
|
-
export declare function useHandleDeleteItem(setValue: Handler): (item?: ItemWithId) => () => void;
|
|
29
|
+
export declare function useHandleDeleteItem(setValue: Handler): (item?: ItemWithId) => (e?: MouseEvent<HTMLButtonElement>) => void;
|
|
30
30
|
export {};
|
|
@@ -55,8 +55,9 @@ export function useSearchInput({ value, onChange, defaultValue }) {
|
|
|
55
55
|
return { inputValue, onInputValueChange, prevInputValue };
|
|
56
56
|
}
|
|
57
57
|
export function useHandleDeleteItem(setValue) {
|
|
58
|
-
return useCallback((item) => () => {
|
|
58
|
+
return useCallback((item) => (e) => {
|
|
59
59
|
var _a;
|
|
60
|
+
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
60
61
|
if (!item) {
|
|
61
62
|
return;
|
|
62
63
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Fields",
|
|
7
|
-
"version": "0.17.
|
|
7
|
+
"version": "0.17.9",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@snack-uikit/locale": "*"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "396d85d77756f5a0f877aee7d35b7f2c160a1e86"
|
|
60
60
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyboardEvent, KeyboardEventHandler, RefObject, useCallback, useMemo, useRef } from 'react';
|
|
1
|
+
import { KeyboardEvent, KeyboardEventHandler, MouseEvent, RefObject, useCallback, useMemo, useRef } from 'react';
|
|
2
2
|
import { Handler } from 'uncontrollable';
|
|
3
3
|
|
|
4
4
|
import { useButtonNavigation, useClearButton } from '@snack-uikit/input-private';
|
|
@@ -108,7 +108,9 @@ export function useSearchInput({ value, onChange, defaultValue }: SearchState) {
|
|
|
108
108
|
|
|
109
109
|
export function useHandleDeleteItem(setValue: Handler) {
|
|
110
110
|
return useCallback(
|
|
111
|
-
(item?: ItemWithId) => () => {
|
|
111
|
+
(item?: ItemWithId) => (e?: MouseEvent<HTMLButtonElement>) => {
|
|
112
|
+
e?.stopPropagation();
|
|
113
|
+
|
|
112
114
|
if (!item) {
|
|
113
115
|
return;
|
|
114
116
|
}
|