TypeError: Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element'. in `monitorResize`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, react
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu trong util.js tại monitorResize và kiểm tra lời gọi từ Align.js:110; tái hiện tương tác hover được mô tả trong issue và xác nhận giá trị nào được truyền đến ResizeObserver.observe. Hoàn tất nghĩa là đường đi qua hover không còn phát sinh TypeError đã báo cáo; issue không nêu tên tệp kiểm thử nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The following error happens when hovering an element.
See video: https://youtu.be/-aLHvTHvp7Q
TypeError: Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element'.
at ft (util.js:58)
at Align.js:110
at Oi (react-dom.production.min.js:262)
at KqkS.t.unstable_runWithPriority (scheduler.production.min.js:18)
at jl (react-dom.production.min.js:122)
at Ti (react-dom.production.min.js:261)
at pi (react-dom.production.min.js:243)
at react-dom.production.min.js:123
at KqkS.t.unstable_runWithPriority (scheduler.production.min.js:18)
at jl (react-dom.production.min.js:122)
at Hl (react-dom.production.min.js:123)
at $l (react-dom.production.min.js:122)
at De (react-dom.production.min.js:292)
at react-dom.production.min.js:50
at zr (react-dom.production.min.js:105)
at Zt (react-dom.production.min.js:75)
at Jt (react-dom.production.min.js:74)
at KqkS.t.unstable_runWithPriority (scheduler.production.min.js:18)
at Gt (react-dom.production.min.js:73)
at HTMLDivElement.o (helpers.js:72)
Unminified code monitorResize:
export function monitorResize(element, callback) {
var prevWidth = null;
var prevHeight = null;
function onResize(_ref) {
var _ref2 = _slicedToArray(_ref, 1)
, target = _ref2[0].target;
if (!document.documentElement.contains(target))
return;
var _target$getBoundingCl = target.getBoundingClientRect()
, width = _target$getBoundingCl.width
, height = _target$getBoundingCl.height;
var fixedWidth = Math.floor(width);
var fixedHeight = Math.floor(height);
if (prevWidth !== fixedWidth || prevHeight !== fixedHeight) {
// https://webkit.org/blog/9997/resizeobserver-in-webkit/
Promise.resolve().then(function() {
callback({
width: fixedWidth,
height: fixedHeight
});
});
}
prevWidth = fixedWidth;
prevHeight = fixedHeight;
}
var resizeObserver = new ResizeObserver(onResize);
if (element) {
resizeObserver.observe(element); // CRASHES HERE
}
return function() {
resizeObserver.disconnect();
}
;
}
- Ngôn ngữ chính
- TypeScript
- Star
- 944
- Fork
- 199
- Merge trung bình
- 19 giờ 1 phút
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của react-component/tooltip
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
react-component/tooltip#510 · 1 bình luận ·
-
rc-tooltip@6.4.0 arrow style bug Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
react-component/tooltip#499 · 1 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
react-component/tooltip#488 · 4 bình luận · 2 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
react-component/tooltip#487 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
react-component/tooltip#483 ·
Tất cả issue của react-component/tooltip
Issue tương tự
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Crush Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ElementsProject/cln-application#167 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Quantco/pnpm-licenses#17 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100