Skip to content

Commit

Permalink
#10374: Changing the layer's opacity in a Map View makes MapStore cra…
Browse files Browse the repository at this point in the history
…sh (#10417) (#10422)
  • Loading branch information
mahmoudadel54 authored Jun 12, 2024
1 parent 5f54c3d commit dbee6f5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
Alert
} from 'react-bootstrap';
import Select from 'react-select';
import {clamp} from 'lodash';
import FormControl from '../../misc/DebouncedFormControl';
import { formatClippingFeatures } from '../../../utils/MapViewsUtils';
import Message from '../../I18N/Message';
Expand Down Expand Up @@ -104,7 +105,10 @@ function LayerOverridesNode({
className="opacity-field"
fallbackValue={1}
value={layer.opacity}
onChange={(value) => onChange({ opacity: value })}
onChange={(value) => {
const opacity = value && clamp(parseFloat(value), 0, 1);
onChange({ opacity: opacity || 0 });
}}
/>
</FormGroup>}
{isClippingSupported && <div className="ms-map-views-layer-clipping">
Expand Down

0 comments on commit dbee6f5

Please sign in to comment.