Skip to content

Commit

Permalink
[Bug] Prevent dragging legend component outside of container (#2885)
Browse files Browse the repository at this point in the history
Signed-off-by: Ritesh9876 <riteshmangdare@gmail.com>
  • Loading branch information
Ritesh9876 authored Jan 2, 2025
1 parent d549fcd commit 23f6034
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/src/map/map-legend-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {withState} from '../injector';
import MapControlPanelFactory from './map-control-panel';
import MapControlTooltipFactory from './map-control-tooltip';
import MapLegendFactory from './map-legend';
import {restrictToWindowEdges} from '@dnd-kit/modifiers';

const DRAG_RESIZE_ID = 'map-legend-resize';
const DRAG_MOVE_ID = 'map-legend-move';
Expand Down Expand Up @@ -203,6 +204,7 @@ const DraggableLegend = withState(
onDragStart={handleDragStart}
onDragMove={handleDragMove}
onDragEnd={handleDragEnd}
modifiers={[restrictToWindowEdges]}
>
<DraggableLegendContent
ref={legendContentRef}
Expand Down

0 comments on commit 23f6034

Please sign in to comment.