fix(editor): Only drag folders when holding mouse 1 button (#16809)

This commit is contained in:
Jaakko Husso
2025-06-30 12:57:18 +03:00
committed by GitHub
parent 7e76222d3c
commit c8a7156254
3 changed files with 4 additions and 4 deletions

View File

@@ -76,7 +76,7 @@ describe('Data mapping', () => {
.inputTbodyCell(1, 0)
.find('span')
.contains('count')
.trigger('mousedown', { force: true });
.trigger('mousedown', { force: true, button: 0, buttons: 1 });
ndv.actions.mapToParameter('value');
ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.input[0].count }}');

View File

@@ -38,7 +38,7 @@ const draggableStyle = computed<StyleValue>(() => ({
}));
const onDragStart = (event: MouseEvent) => {
if (props.disabled) {
if (props.disabled || event.buttons !== 1) {
return;
}

View File

@@ -526,8 +526,8 @@ describe('VirtualSchema.vue', () => {
function dragDropPill(pill: HTMLElement) {
const ndvStore = useNDVStore();
const reset = vi.spyOn(ndvStore, 'resetMappingTelemetry');
fireEvent(pill, new MouseEvent('mousedown', { bubbles: true }));
fireEvent(window, new MouseEvent('mousemove', { bubbles: true }));
fireEvent(pill, new MouseEvent('mousedown', { bubbles: true, button: 0, buttons: 1 }));
fireEvent(window, new MouseEvent('mousemove', { bubbles: true, button: 0, buttons: 1 }));
expect(reset).toHaveBeenCalled();
vi.useRealTimers();