@team-monolith/cds 1.97.2 → 1.97.3
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.
|
@@ -23,7 +23,7 @@ import { Tooltip as MuiTooltip, } from "@mui/material";
|
|
|
23
23
|
* 3. tabIndex가 의도적으로 음수로 설정되어 있으면
|
|
24
24
|
* 그대로 반환합니다.
|
|
25
25
|
*/
|
|
26
|
-
function
|
|
26
|
+
function addTabIndexIfNeeded(element) {
|
|
27
27
|
var _a;
|
|
28
28
|
// element.props 접근시 ValidElement가 아닌 경우 런타임에러가 발생합니다.
|
|
29
29
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -46,7 +46,7 @@ function getFocusableElement(element) {
|
|
|
46
46
|
*/
|
|
47
47
|
export const Tooltip = React.forwardRef(function Tooltip(props, ref) {
|
|
48
48
|
const { title, text, children } = props, restProps = __rest(props, ["title", "text", "children"]);
|
|
49
|
-
const focusableChildren =
|
|
49
|
+
const focusableChildren = addTabIndexIfNeeded(children);
|
|
50
50
|
return (_jsx(StyledTooltip, Object.assign({ ref: ref, title:
|
|
51
51
|
// title이 없고 text가 null인 경우 툴팁을 표시하지 않음
|
|
52
52
|
!title && text === null ? null : (_jsxs(_Fragment, { children: [title && _jsx(TitleDiv, { children: title }), text] })), describeChild: true }, restProps, { children: focusableChildren })));
|