Skip to content

Commit

Permalink
Fix layer panel scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed May 28, 2024
1 parent f381f52 commit 53596c9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/static/app/js/components/LayersControlPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import '../css/LayersControlPanel.scss';
import LayersControlLayer from './LayersControlLayer';
import LayersControlAnnotations from './LayersControlAnnotations';
import { _ } from '../classes/gettext';
import L from 'leaflet';

export default class LayersControlPanel extends React.Component {
static defaultProps = {
Expand All @@ -23,6 +24,14 @@ export default class LayersControlPanel extends React.Component {
super(props);
}

componentDidMount(){
L.DomEvent.on(this.domNode, 'mousewheel', L.DomEvent.stopPropagation);
}

componentWillUnmount(){
L.DomEvent.off(this.domNode, 'mousewheel', L.DomEvent.stopPropagation);
}

render(){
let content = "";

Expand Down Expand Up @@ -89,7 +98,7 @@ export default class LayersControlPanel extends React.Component {
</div>);
}

return (<div className="layers-control-panel">
return (<div className="layers-control-panel" ref={(domNode) => this.domNode = domNode}>
<span className="close-button" onClick={this.props.onClose}/>
<div className="title">{_("Layers")}</div>
<hr/>
Expand Down

0 comments on commit 53596c9

Please sign in to comment.