From 85d09ad3310c26d61b6af60b28d680eed1f2bf1c Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 29 Nov 2015 15:14:32 +0800 Subject: [PATCH] show scrollbar when hover --- assets/index/Select.less | 10 ++++++---- src/module/Select.jsx | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/assets/index/Select.less b/assets/index/Select.less index 4efeac9..bca25f9 100644 --- a/assets/index/Select.less +++ b/assets/index/Select.less @@ -8,6 +8,10 @@ width: 56px; overflow: hidden; + &:hover { + overflow-y: auto; + } + &:first-child { border-left: 0; margin-left: 0; @@ -19,18 +23,16 @@ ul { list-style: none; - box-sizing: content-box; + box-sizing: border-box; margin: 0; padding: 0; width: 100%; max-height: 144px; - overflow: auto; - padding-right: 16px; } li { list-style: none; - box-sizing: content-box; + box-sizing: border-box; margin: 0; padding: 0 0 0 16px; width: 100%; diff --git a/src/module/Select.jsx b/src/module/Select.jsx index 119e59e..b386d07 100644 --- a/src/module/Select.jsx +++ b/src/module/Select.jsx @@ -64,7 +64,7 @@ const Select = React.createClass({ } const topOption = list.children[index]; const to = topOption.offsetTop - select.offsetTop; - scrollTo(list, to, duration); + scrollTo(select, to, duration); }, render() { -- 2.41.0