diff options
author | Naafiyan Ahmed <naafiyan@gmail.com> | 2022-07-12 12:08:49 -0400 |
---|---|---|
committer | Naafiyan Ahmed <naafiyan@gmail.com> | 2022-07-12 12:08:49 -0400 |
commit | 9ad978eac113cf3559d885c62a9368a68f6333ec (patch) | |
tree | 8daa3a5663379b29d8121aaa39e80cfd5e7fd9ed /src/client/util/ScrollBox.tsx | |
parent | 31041d7a5b2c3699518ebb33ccab016af0acd579 (diff) | |
parent | 5628b585fa6356d66cf2e7454be20e3b847ad22e (diff) |
merged master
Diffstat (limited to 'src/client/util/ScrollBox.tsx')
-rw-r--r-- | src/client/util/ScrollBox.tsx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/client/util/ScrollBox.tsx b/src/client/util/ScrollBox.tsx index a209874a3..d4620ae3f 100644 --- a/src/client/util/ScrollBox.tsx +++ b/src/client/util/ScrollBox.tsx @@ -1,21 +1,24 @@ -import React = require("react"); +import React = require('react'); -export class ScrollBox extends React.Component { +export class ScrollBox extends React.Component<React.PropsWithChildren<{}>> { onWheel = (e: React.WheelEvent) => { - if (e.currentTarget.scrollHeight > e.currentTarget.clientHeight) { // If the element has a scroll bar, then we don't want the containing collection to zoom + if (e.currentTarget.scrollHeight > e.currentTarget.clientHeight) { + // If the element has a scroll bar, then we don't want the containing collection to zoom e.stopPropagation(); } - } + }; render() { return ( - <div style={{ - overflow: "auto", - width: "100%", - height: "100%", - }} onWheel={this.onWheel}> + <div + style={{ + overflow: 'auto', + width: '100%', + height: '100%', + }} + onWheel={this.onWheel}> {this.props.children} </div> ); } -}
\ No newline at end of file +} |