From b3feba603ddc3b8260c9925bef0617160e3415a5 Mon Sep 17 00:00:00 2001 From: Stas Date: Wed, 5 May 2021 15:07:23 +0200 Subject: [PATCH] Align center --- src/Select.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Select.jsx b/src/Select.jsx index 245d60ec..1b615aa7 100644 --- a/src/Select.jsx +++ b/src/Select.jsx @@ -107,7 +107,7 @@ class Select extends Component { index = 0; } const topOption = this.list.children[index]; - const to = topOption.offsetTop; + const to = topOption.offsetTop + topOption.offsetHeight / 2 - this.root.offsetHeight / 2; // align center scrollTo(this.root, to, duration); }