@gustavo-valsechi/client 1.4.92 → 1.4.93
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.
|
@@ -104,24 +104,8 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
104
104
|
import_lodash.default.forEach(targets, (target, index) => {
|
|
105
105
|
var _a;
|
|
106
106
|
const element = (_a = target.ref) == null ? void 0 : _a.current;
|
|
107
|
+
console.log(element);
|
|
107
108
|
if (!element) return;
|
|
108
|
-
element.addEventListener("click", () => {
|
|
109
|
-
const targetElement = import_lodash.default.find(containerRef.current, (data, i) => i === index);
|
|
110
|
-
if (!targetElement) return;
|
|
111
|
-
console.log("document.activeElement", document.activeElement);
|
|
112
|
-
console.log("elementFocusable", elementFocusable(target, index));
|
|
113
|
-
console.log("target focus", elementFocusable(target, index) === document.activeElement);
|
|
114
|
-
if (elementFocusable(target, index) === document.activeElement) {
|
|
115
|
-
close(targetElement);
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const coords = getCoords(element);
|
|
119
|
-
open(targetElement, coords);
|
|
120
|
-
elementFocusable(target, index).focus();
|
|
121
|
-
});
|
|
122
|
-
element.addEventListener("resize", () => {
|
|
123
|
-
import_lodash.default.forEach(containerRef.current, (elementRef) => close(elementRef));
|
|
124
|
-
});
|
|
125
109
|
});
|
|
126
110
|
}, [targets, inputRef, containerRef]);
|
|
127
111
|
const getCoords = (target) => {
|
|
@@ -70,24 +70,8 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
70
70
|
_.forEach(targets, (target, index) => {
|
|
71
71
|
var _a;
|
|
72
72
|
const element = (_a = target.ref) == null ? void 0 : _a.current;
|
|
73
|
+
console.log(element);
|
|
73
74
|
if (!element) return;
|
|
74
|
-
element.addEventListener("click", () => {
|
|
75
|
-
const targetElement = _.find(containerRef.current, (data, i) => i === index);
|
|
76
|
-
if (!targetElement) return;
|
|
77
|
-
console.log("document.activeElement", document.activeElement);
|
|
78
|
-
console.log("elementFocusable", elementFocusable(target, index));
|
|
79
|
-
console.log("target focus", elementFocusable(target, index) === document.activeElement);
|
|
80
|
-
if (elementFocusable(target, index) === document.activeElement) {
|
|
81
|
-
close(targetElement);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const coords = getCoords(element);
|
|
85
|
-
open(targetElement, coords);
|
|
86
|
-
elementFocusable(target, index).focus();
|
|
87
|
-
});
|
|
88
|
-
element.addEventListener("resize", () => {
|
|
89
|
-
_.forEach(containerRef.current, (elementRef) => close(elementRef));
|
|
90
|
-
});
|
|
91
75
|
});
|
|
92
76
|
}, [targets, inputRef, containerRef]);
|
|
93
77
|
const getCoords = (target) => {
|