@vaadin/grid 22.0.7 → 22.0.10

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": "22.0.7",
3
+ "version": "22.0.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -40,19 +40,19 @@
40
40
  "dependencies": {
41
41
  "@open-wc/dedupe-mixin": "^1.3.0",
42
42
  "@polymer/polymer": "^3.0.0",
43
- "@vaadin/checkbox": "^22.0.7",
44
- "@vaadin/component-base": "^22.0.7",
45
- "@vaadin/text-field": "^22.0.7",
46
- "@vaadin/vaadin-lumo-styles": "^22.0.7",
47
- "@vaadin/vaadin-material-styles": "^22.0.7",
48
- "@vaadin/vaadin-themable-mixin": "^22.0.7"
43
+ "@vaadin/checkbox": "^22.0.10",
44
+ "@vaadin/component-base": "^22.0.10",
45
+ "@vaadin/text-field": "^22.0.10",
46
+ "@vaadin/vaadin-lumo-styles": "^22.0.10",
47
+ "@vaadin/vaadin-material-styles": "^22.0.10",
48
+ "@vaadin/vaadin-themable-mixin": "^22.0.10"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@esm-bundle/chai": "^4.3.4",
52
- "@vaadin/polymer-legacy-adapter": "^22.0.7",
52
+ "@vaadin/polymer-legacy-adapter": "^22.0.10",
53
53
  "@vaadin/testing-helpers": "^0.3.2",
54
54
  "lit": "^2.0.0",
55
55
  "sinon": "^9.2.0"
56
56
  },
57
- "gitHead": "947d74491296ca746b360ecb5f5a8efd55ab2866"
57
+ "gitHead": "5977183ebfe56b017da471fd9162bb72e9ed477a"
58
58
  }
@@ -91,6 +91,9 @@ export const KeyboardNavigationMixin = (superClass) =>
91
91
  this.addEventListener('mousedown', () => {
92
92
  this.toggleAttribute('navigating', false);
93
93
  this._isMousedown = true;
94
+
95
+ // Reset stored order when moving focus with mouse.
96
+ this._focusedColumnOrder = undefined;
94
97
  });
95
98
  this.addEventListener('mouseup', () => (this._isMousedown = false));
96
99
  }
@@ -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 { processTemplates } from '@vaadin/component-base/src/templates.js';
13
13
  import { Virtualizer } from '@vaadin/component-base/src/virtualizer.js';
@@ -658,13 +658,16 @@ class Grid extends ElementMixin(
658
658
  // focusable slot wrapper, that is why cells are not focused with
659
659
  // mousedown. Workaround: listen for mousedown and focus manually.
660
660
  cellContent.addEventListener('mousedown', () => {
661
- if (window.chrome) {
661
+ if (isChrome) {
662
662
  // Chrome bug: focusing before mouseup prevents text selection, see http://crbug.com/771903
663
- const mouseUpListener = () => {
664
- if (!cellContent.contains(this.getRootNode().activeElement)) {
663
+ const mouseUpListener = (event) => {
664
+ // If focus is on element within the cell content — respect it, do not change
665
+ const contentContainsFocusedElement = cellContent.contains(this.getRootNode().activeElement);
666
+ // Only focus if mouse is released on cell content itself
667
+ const mouseUpWithinCell = cellContent.contains(event.target);
668
+ if (!contentContainsFocusedElement && mouseUpWithinCell) {
665
669
  cell.focus();
666
670
  }
667
- // If focus is in the cell content — respect it, do not change.
668
671
  document.removeEventListener('mouseup', mouseUpListener, true);
669
672
  };
670
673
  document.addEventListener('mouseup', mouseUpListener, true);