Skip to content

Commit b1d439e

Browse files
authored
dxDiagram - fix bubble mousedown events, scrollbar (T1305123, T1304998) (#31152)
1 parent 17c03a1 commit b1d439e

File tree

10 files changed

+29
-20
lines changed

10 files changed

+29
-20
lines changed
-6.11 KB
Loading
-6.18 KB
Loading
-6.36 KB
Loading
-1.92 KB
Loading
-2.35 KB
Loading
-995 Bytes
Loading

packages/devextreme/js/ui/diagram/ui.diagram.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const DIAGRAM_FLOATING_TOOLBAR_CONTAINER_CLASS = DIAGRAM_CLASS + '-floating-tool
4747
const DIAGRAM_PROPERTIES_PANEL_TOOLBAR_CONTAINER_CLASS = DIAGRAM_CLASS + '-properties-panel-toolbar-container';
4848
const DIAGRAM_LOADING_INDICATOR_CLASS = DIAGRAM_CLASS + '-loading-indicator';
4949
const DIAGRAM_FLOATING_PANEL_OFFSET = 12;
50+
const DIAGRAM_PROPERTIES_PANEL_NS_OFFSET = 16;
5051

5152
const DIAGRAM_DEFAULT_UNIT = 'in';
5253
const DIAGRAM_DEFAULT_ZOOMLEVEL = 1;
@@ -474,21 +475,22 @@ class Diagram extends Widget {
474475
}
475476
_updatePropertiesToolbarPosition($container, $parent, isServerSide) {
476477
if(isServerSide) return;
477-
478+
const offset = this.option('useNativeScrolling') ? DIAGRAM_PROPERTIES_PANEL_NS_OFFSET : DIAGRAM_FLOATING_PANEL_OFFSET;
478479
positionUtils.setup($container, {
479480
my: 'right bottom',
480481
at: 'right bottom',
481482
of: $parent,
482-
offset: '-' + DIAGRAM_FLOATING_PANEL_OFFSET + ' -' + DIAGRAM_FLOATING_PANEL_OFFSET
483+
offset: `-${offset}px -${offset}px`
483484
});
484485
}
485486
_renderPropertiesPanel($parent) {
486487
const isServerSide = !hasWindow();
487488
const $propertiesPanel = $('<div>')
488489
.appendTo($parent);
489490

490-
const offsetX = DIAGRAM_FLOATING_PANEL_OFFSET;
491-
const offsetY = 2 * DIAGRAM_FLOATING_PANEL_OFFSET + (!isServerSide ? getOuterHeight(this._propertiesToolbar.$element()) : 0);
491+
const offset = this.option('useNativeScrolling') ? DIAGRAM_PROPERTIES_PANEL_NS_OFFSET : DIAGRAM_FLOATING_PANEL_OFFSET;
492+
const offsetX = offset;
493+
const offsetY = 2 * offset + (!isServerSide ? getOuterHeight(this._propertiesToolbar.$element()) : 0);
492494
this._propertiesPanel = this._createComponent($propertiesPanel, DiagramPropertiesPanel, {
493495
isMobileView: this.isMobileScreenSize(),
494496
isVisible: this._isPropertiesPanelVisible(),

packages/devextreme/testing/tests/DevExpress.ui.widgets/diagramParts/options.tests.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ QUnit.module('Options', {
333333
assert.equal(this.instance._diagramInstance.model.units, 0);
334334
});
335335
test('should change pageSize property', function(assert) {
336-
assert.equal(this.instance._diagramInstance.model.pageSize.width, 8391);
337-
assert.equal(this.instance._diagramInstance.model.pageSize.height, 11906);
336+
assert.equal(this.instance._diagramInstance.model.pageSize.width, 8400);
337+
assert.equal(this.instance._diagramInstance.model.pageSize.height, 11910);
338338
this.instance.option('pageSize', { width: 3, height: 5 });
339339
assert.equal(this.instance._diagramInstance.model.pageSize.width, 4320);
340340
assert.equal(this.instance._diagramInstance.model.pageSize.height, 7200);
@@ -351,8 +351,8 @@ QUnit.module('Options', {
351351
assert.equal(this.onOptionChanged.getCalls().length, 3); // +hasChanges
352352
});
353353
test('should change pageSize object property', function(assert) {
354-
assert.equal(this.instance._diagramInstance.model.pageSize.width, 8391);
355-
assert.equal(this.instance._diagramInstance.model.pageSize.height, 11906);
354+
assert.equal(this.instance._diagramInstance.model.pageSize.width, 8400);
355+
assert.equal(this.instance._diagramInstance.model.pageSize.height, 11910);
356356
assert.equal(this.instance._diagramInstance.settings.pageSizeItems.length, 11);
357357
this.instance.option('pageSize', { width: 3, height: 5, items: [{ width: 3, height: 5, text: 'A10' }] });
358358
assert.equal(this.instance._diagramInstance.model.pageSize.width, 4320);
@@ -752,8 +752,8 @@ QUnit.module('Options (initially set)', {
752752

753753
assert.ok(instance._diagramInstance.settings.readOnly);
754754
assert.equal(instance._diagramInstance.model.pageColor, -1); // FFFFFF
755-
assert.equal(instance._diagramInstance.model.pageSize.width, 8391);
756-
assert.equal(instance._diagramInstance.model.pageSize.height, 11906);
755+
assert.equal(instance._diagramInstance.model.pageSize.width, 8400);
756+
assert.equal(instance._diagramInstance.model.pageSize.height, 11910);
757757
assert.ok(instance._diagramInstance.settings.snapToGrid);
758758
});
759759
});

pnpm-lock.yaml

Lines changed: 16 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ packages:
55
- 'packages/devextreme/artifacts/npm/devextreme-dist'
66

77
catalog:
8-
devexpress-diagram: 2.2.19
8+
devexpress-diagram: 2.2.24
99
devexpress-gantt: 4.1.62
1010
devextreme-quill: 1.7.4

0 commit comments

Comments
 (0)