@teamturing/react-kit 2.27.1 → 2.28.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/dist/index.js +17204 -17191
- package/esm/core/SearchSelectInput/index.js +16 -2
- package/package.json +2 -2
|
@@ -9,6 +9,7 @@ import { noop } from '../../packages/utils/esm/noop.js';
|
|
|
9
9
|
import { scrollIntoView } from '../../packages/utils/esm/scrollIntoView.js';
|
|
10
10
|
import { r as reactIsExports } from '../../node_modules/react-is/index.js';
|
|
11
11
|
import styled, { css, useTheme } from 'styled-components';
|
|
12
|
+
import useDevice from '../../hook/useDevice.js';
|
|
12
13
|
import useProvidedOrCreatedRef from '../../hook/useProvidedOrCreatedRef.js';
|
|
13
14
|
import HorizontalDivider from '../HorizontalDivider/index.js';
|
|
14
15
|
import Overlay from '../Overlay/index.js';
|
|
@@ -38,6 +39,9 @@ const SearchSelectInput = ({
|
|
|
38
39
|
...props
|
|
39
40
|
}, ref) => {
|
|
40
41
|
const theme = useTheme();
|
|
42
|
+
const {
|
|
43
|
+
isDesktop
|
|
44
|
+
} = useDevice();
|
|
41
45
|
const isVisibleValueExist = value && isArray(value) && !isNullable(renderValue(value)) ? value.length > 0 : value && !isNullable(renderValue(value));
|
|
42
46
|
const hasLeadingVisual = !isNullable(LeadingVisual);
|
|
43
47
|
const valueInputRef = useProvidedOrCreatedRef(ref);
|
|
@@ -65,12 +69,18 @@ const SearchSelectInput = ({
|
|
|
65
69
|
onChange?.(item);
|
|
66
70
|
}
|
|
67
71
|
};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* ? dummyRef가 왜 있나?
|
|
75
|
+
* 모바일 환경에서 Input에 포커스가 가지 않도록 하기 위한 장치입니다.
|
|
76
|
+
*/
|
|
77
|
+
const dummyRef = useRef(null);
|
|
68
78
|
const listContainerRef = useRef(null);
|
|
69
79
|
const searchInputRef = useRef(null);
|
|
70
80
|
const activeDescendantRef = useRef();
|
|
71
81
|
return /*#__PURE__*/jsxRuntimeExports.jsx(OverlayPopper, {
|
|
72
82
|
focusTrapSettings: {
|
|
73
|
-
initialFocusRef: searchInputRef,
|
|
83
|
+
initialFocusRef: isDesktop ? searchInputRef : dummyRef,
|
|
74
84
|
restoreFocusOnCleanUp: true,
|
|
75
85
|
...focusTrapSettings
|
|
76
86
|
},
|
|
@@ -123,7 +133,11 @@ const SearchSelectInput = ({
|
|
|
123
133
|
overlayHandler.closeOverlay();
|
|
124
134
|
}
|
|
125
135
|
},
|
|
126
|
-
children: [/*#__PURE__*/jsxRuntimeExports.jsx(
|
|
136
|
+
children: [!isDesktop ? /*#__PURE__*/jsxRuntimeExports.jsx(View, {
|
|
137
|
+
"aria-hidden": true,
|
|
138
|
+
ref: dummyRef,
|
|
139
|
+
tabIndex: 0
|
|
140
|
+
}) : null, /*#__PURE__*/jsxRuntimeExports.jsx(Space, {
|
|
127
141
|
p: 2,
|
|
128
142
|
sx: {
|
|
129
143
|
flexGrow: 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamturing/react-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.0",
|
|
4
4
|
"description": "React components, hooks for create teamturing web application",
|
|
5
5
|
"author": "Sungchang Park <psch300@gmail.com> (https://github.com/psch300)",
|
|
6
6
|
"homepage": "https://github.com/weareteamturing/bombe#readme",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"react-textarea-autosize": "^8.5.3",
|
|
67
67
|
"styled-system": "^5.1.5"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "56bd9e11df60092d7bad4459c2ce79a7d8fe0039"
|
|
70
70
|
}
|