@vaadin/grid 23.0.2 → 23.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -41,19 +41,19 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
43
43
|
"@polymer/polymer": "^3.0.0",
|
|
44
|
-
"@vaadin/checkbox": "^23.0.
|
|
45
|
-
"@vaadin/component-base": "^23.0.
|
|
46
|
-
"@vaadin/text-field": "^23.0.
|
|
47
|
-
"@vaadin/vaadin-lumo-styles": "^23.0.
|
|
48
|
-
"@vaadin/vaadin-material-styles": "^23.0.
|
|
49
|
-
"@vaadin/vaadin-themable-mixin": "^23.0.
|
|
44
|
+
"@vaadin/checkbox": "^23.0.3",
|
|
45
|
+
"@vaadin/component-base": "^23.0.3",
|
|
46
|
+
"@vaadin/text-field": "^23.0.3",
|
|
47
|
+
"@vaadin/vaadin-lumo-styles": "^23.0.3",
|
|
48
|
+
"@vaadin/vaadin-material-styles": "^23.0.3",
|
|
49
|
+
"@vaadin/vaadin-themable-mixin": "^23.0.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@esm-bundle/chai": "^4.3.4",
|
|
53
|
-
"@vaadin/polymer-legacy-adapter": "^23.0.
|
|
53
|
+
"@vaadin/polymer-legacy-adapter": "^23.0.3",
|
|
54
54
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
55
55
|
"lit": "^2.0.0",
|
|
56
56
|
"sinon": "^9.2.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "3f010a4167c9e04405c9dfab098da0821e02a601"
|
|
59
59
|
}
|
|
@@ -57,7 +57,7 @@ export const ColumnResizingMixin = (superClass) =>
|
|
|
57
57
|
const targetCell = columnRowCells.filter((cell) => cell._column === column)[0];
|
|
58
58
|
// Resize the target column
|
|
59
59
|
if (targetCell.offsetWidth) {
|
|
60
|
-
const style =
|
|
60
|
+
const style = getComputedStyle(targetCell._content);
|
|
61
61
|
const minWidth =
|
|
62
62
|
10 +
|
|
63
63
|
parseInt(style.paddingLeft) +
|
package/src/vaadin-grid.js
CHANGED
|
@@ -7,7 +7,7 @@ import './vaadin-grid-column.js';
|
|
|
7
7
|
import './vaadin-grid-styles.js';
|
|
8
8
|
import { beforeNextRender } from '@polymer/polymer/lib/utils/render-status.js';
|
|
9
9
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
10
|
-
import { isAndroid, isFirefox, isIOS, isSafari, isTouch } from '@vaadin/component-base/src/browser-utils.js';
|
|
10
|
+
import { isAndroid, isChrome, isFirefox, isIOS, isSafari, isTouch } from '@vaadin/component-base/src/browser-utils.js';
|
|
11
11
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
12
12
|
import { TabindexMixin } from '@vaadin/component-base/src/tabindex-mixin.js';
|
|
13
13
|
import { processTemplates } from '@vaadin/component-base/src/templates.js';
|
|
@@ -685,13 +685,16 @@ class Grid extends ElementMixin(
|
|
|
685
685
|
// focusable slot wrapper, that is why cells are not focused with
|
|
686
686
|
// mousedown. Workaround: listen for mousedown and focus manually.
|
|
687
687
|
cellContent.addEventListener('mousedown', () => {
|
|
688
|
-
if (
|
|
688
|
+
if (isChrome) {
|
|
689
689
|
// Chrome bug: focusing before mouseup prevents text selection, see http://crbug.com/771903
|
|
690
|
-
const mouseUpListener = () => {
|
|
691
|
-
|
|
690
|
+
const mouseUpListener = (event) => {
|
|
691
|
+
// If focus is on element within the cell content — respect it, do not change
|
|
692
|
+
const contentContainsFocusedElement = cellContent.contains(this.getRootNode().activeElement);
|
|
693
|
+
// Only focus if mouse is released on cell content itself
|
|
694
|
+
const mouseUpWithinCell = cellContent.contains(event.target);
|
|
695
|
+
if (!contentContainsFocusedElement && mouseUpWithinCell) {
|
|
692
696
|
cell.focus();
|
|
693
697
|
}
|
|
694
|
-
// If focus is in the cell content — respect it, do not change.
|
|
695
698
|
document.removeEventListener('mouseup', mouseUpListener, true);
|
|
696
699
|
};
|
|
697
700
|
document.addEventListener('mouseup', mouseUpListener, true);
|