Description
On mobile devices, when dragging the cursor in the elevation chart, the vertical line (.mouse-focus-line) does not stop at the left edge of the chart. It is possible to drag the line far to the left of the chart's visible area.
Steps to Reproduce
- Open a map with the elevation plugin on a mobile device.
- Tap and hold on the elevation chart to show the cursor.
- Drag your finger to the left, past the beginning of the chart.
Expected Behavior
The cursor should stop at the left edge of the chart.
Actual Behavior
The cursor continues to move to the left, off of the chart.
Suggested Fix
This can be fixed by clamping the xCoord value in src/components/chart.js.
In the _initBrush function, inside the focus constant, change the following line:
to this:
let xCoord = _.clamp(coords[0], [0, this._width()]); // Clamps the cursor position to the chart's bounds.
Description
On mobile devices, when dragging the cursor in the elevation chart, the vertical line (
.mouse-focus-line) does not stop at the left edge of the chart. It is possible to drag the line far to the left of the chart's visible area.Steps to Reproduce
Expected Behavior
The cursor should stop at the left edge of the chart.
Actual Behavior
The cursor continues to move to the left, off of the chart.
Suggested Fix
This can be fixed by clamping the
xCoordvalue insrc/components/chart.js.In the
_initBrushfunction, inside thefocusconstant, change the following line:to this: