Skip to content

Commit fcf1dcc

Browse files
authored
Merge pull request #414 from webpack/bugfix/vote-scroll
fix scrolling on vote app
2 parents b2f073e + 1a0780b commit fcf1dcc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/vote/button/button.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ require("./button-style.scss");
44
export default (props) => {
55
let { value, myValue, maxDown, maxUp, color, onVote, className } = props;
66

7-
let click = (n) => {
7+
let click = (e, n) => {
88
onVote(Math.min(maxUp, Math.max(n, -maxDown)));
9+
e.preventDefault();
910
return false;
1011
};
1112

@@ -18,9 +19,9 @@ export default (props) => {
1819

1920
let makeTriangle = (n, fn, size, minForEnabled) => {
2021
const enabled = n > 0 ? (maxUp >= minForEnabled) : (maxDown >= minForEnabled);
21-
return <a href="#"
22+
return <a href="#"
2223
title={titleText(n)}
23-
onClick={() => click(n)}
24+
onClick={e => click(e, n)}
2425
className="vote-button__upMax">
2526
{fn({size: size, color: enabled ? color : "transparent"})}
2627
</a>;

0 commit comments

Comments
 (0)