From 56f1d08c2377602c37bd9c68eb0c98e1d8a2136a Mon Sep 17 00:00:00 2001 From: ShanaMaid Date: Tue, 30 Oct 2018 15:40:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A7=86=E7=AA=97?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E5=AF=BC=E8=87=B4=E7=9A=84=E5=81=8F=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/TimePicker/TimePicker.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/TimePicker/TimePicker.tsx b/components/TimePicker/TimePicker.tsx index 8b7f530..2f62f63 100644 --- a/components/TimePicker/TimePicker.tsx +++ b/components/TimePicker/TimePicker.tsx @@ -125,10 +125,12 @@ export class TimePicker extends Component { return; } const rect = this.refTimePickerConatainer.getBoundingClientRect(); + const pageY = window.pageYOffset; // 当前滚动条y轴偏移量 + const pageX = window.pageXOffset; // 当前滚动条x轴偏移量 this.setState({ panelPos: { - left: rect.left, - top: rect.top, + left: rect.left + pageX, + top: rect.top + pageY, } }); }