Skip to content

Commit

Permalink
In drag offset control, ignore events in the inner input field
Browse files Browse the repository at this point in the history
(closes #1643)
  • Loading branch information
bhousel committed Dec 12, 2024
1 parent 0d3a88b commit 60be1be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/ui/sections/background_offset.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ export function uiSectionBackgroundOffset(context) {
}


function dragOffset(d3_event) {
function pointerdown(d3_event) {
if (d3_event.button !== 0) return;
let input = context.container().selectAll('.nudge-inner-rect > input').node();
if (d3_event.target === input) return; // we are dragging in the input field, not the outer rect

let origin = [d3_event.clientX, d3_event.clientY];
const pointerId = d3_event.pointerId || 'mouse';
Expand Down Expand Up @@ -131,7 +133,7 @@ export function uiSectionBackgroundOffset(context) {
let nudgeEnter = nudgeWrapEnter
.append('div')
.attr('class', 'nudge-outer-rect')
.on('pointerdown', dragOffset);
.on('pointerdown', pointerdown);

nudgeEnter
.append('div')
Expand Down

0 comments on commit 60be1be

Please sign in to comment.