diff options
author | afc163 <afc163@gmail.com> | 2015-11-28 15:55:15 +0800 |
---|---|---|
committer | afc163 <afc163@gmail.com> | 2015-11-28 15:59:08 +0800 |
commit | ec9325586535a0067af78586873349f53dcfdd4c (patch) | |
tree | 0e1026cdc156bed872c500c8612908d7fdf3b769 | |
parent | a9fbba23bb3eca7275602bf27183cdb3e34071cf (diff) | |
download | time-picker-ec9325586535a0067af78586873349f53dcfdd4c.tar.gz time-picker-ec9325586535a0067af78586873349f53dcfdd4c.tar.zst time-picker-ec9325586535a0067af78586873349f53dcfdd4c.zip |
scroll without a scroll bar
http://stackoverflow.com/questions/25095539/allow-scroll-but-hide-scrollbar
-rw-r--r-- | assets/index/Select.less | 8 | ||||
-rw-r--r-- | src/module/Select.jsx | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/assets/index/Select.less b/assets/index/Select.less index e93e8f7..4efeac9 100644 --- a/assets/index/Select.less +++ b/assets/index/Select.less | |||
@@ -1,12 +1,12 @@ | |||
1 | .@{prefixClass}-panel-select { | 1 | .@{prefixClass}-panel-select { |
2 | float: left; | 2 | float: left; |
3 | overflow-y:auto; | ||
4 | font-size: 12px; | 3 | font-size: 12px; |
5 | border: 1px solid #e9e9e9; | 4 | border: 1px solid #e9e9e9; |
6 | border-width: 0 1px; | 5 | border-width: 0 1px; |
7 | margin-left: -1px; | 6 | margin-left: -1px; |
8 | box-sizing: border-box; | 7 | box-sizing: border-box; |
9 | width: 56px; | 8 | width: 56px; |
9 | overflow: hidden; | ||
10 | 10 | ||
11 | &:first-child { | 11 | &:first-child { |
12 | border-left: 0; | 12 | border-left: 0; |
@@ -19,16 +19,18 @@ | |||
19 | 19 | ||
20 | ul { | 20 | ul { |
21 | list-style: none; | 21 | list-style: none; |
22 | box-sizing: border-box; | 22 | box-sizing: content-box; |
23 | margin: 0; | 23 | margin: 0; |
24 | padding: 0; | 24 | padding: 0; |
25 | width: 100%; | 25 | width: 100%; |
26 | max-height: 144px; | 26 | max-height: 144px; |
27 | overflow: auto; | ||
28 | padding-right: 16px; | ||
27 | } | 29 | } |
28 | 30 | ||
29 | li { | 31 | li { |
30 | list-style: none; | 32 | list-style: none; |
31 | box-sizing: border-box; | 33 | box-sizing: content-box; |
32 | margin: 0; | 34 | margin: 0; |
33 | padding: 0 0 0 16px; | 35 | padding: 0 0 0 16px; |
34 | width: 100%; | 36 | width: 100%; |
diff --git a/src/module/Select.jsx b/src/module/Select.jsx index b386d07..119e59e 100644 --- a/src/module/Select.jsx +++ b/src/module/Select.jsx | |||
@@ -64,7 +64,7 @@ const Select = React.createClass({ | |||
64 | } | 64 | } |
65 | const topOption = list.children[index]; | 65 | const topOption = list.children[index]; |
66 | const to = topOption.offsetTop - select.offsetTop; | 66 | const to = topOption.offsetTop - select.offsetTop; |
67 | scrollTo(select, to, duration); | 67 | scrollTo(list, to, duration); |
68 | }, | 68 | }, |
69 | 69 | ||
70 | render() { | 70 | render() { |