@vaadin/component-base 25.1.1 → 25.1.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/component-base",
3
- "version": "25.1.1",
3
+ "version": "25.1.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,11 +38,11 @@
38
38
  "lit": "^3.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@vaadin/chai-plugins": "~25.1.1",
42
- "@vaadin/test-runner-commands": "~25.1.1",
41
+ "@vaadin/chai-plugins": "~25.1.3",
42
+ "@vaadin/test-runner-commands": "~25.1.3",
43
43
  "@vaadin/testing-helpers": "^2.0.0",
44
44
  "sinon": "^21.0.2"
45
45
  },
46
46
  "customElements": "custom-elements.json",
47
- "gitHead": "2687401ae7636c5ba38573b1f3d3ad62caf80513"
47
+ "gitHead": "6faa3dbd92204cfda519d0146de376084234f560"
48
48
  }
package/src/define.js CHANGED
@@ -13,7 +13,7 @@ function dashToCamelCase(dash) {
13
13
 
14
14
  const experimentalMap = {};
15
15
 
16
- export function defineCustomElement(CustomElement, version = '25.1.1') {
16
+ export function defineCustomElement(CustomElement, version = '25.1.3') {
17
17
  Object.defineProperty(CustomElement, 'version', {
18
18
  get() {
19
19
  return version;
@@ -521,11 +521,19 @@ export class IronListAdapter {
521
521
 
522
522
  /** @private */
523
523
  __getFocusedElement(visibleElements = this.__getVisibleElements()) {
524
- return visibleElements.find(
525
- (element) =>
526
- element.contains(this.elementsContainer.getRootNode().activeElement) ||
527
- element.contains(this.scrollTarget.getRootNode().activeElement),
528
- );
524
+ // `document.activeElement` retargets to the outermost shadow host when
525
+ // focus lives in a nested shadow tree. Descend through nested shadow
526
+ // roots' `activeElement`s to reach the real focused node, then walk up
527
+ // the flattened tree (via `assignedSlot`/`parentNode`/`host`) until a
528
+ // visible row is reached.
529
+ let node = document.activeElement;
530
+ while (node?.shadowRoot?.activeElement) {
531
+ node = node.shadowRoot.activeElement;
532
+ }
533
+ while (node && !visibleElements.includes(node)) {
534
+ node = node.assignedSlot || node.parentNode || node.host;
535
+ }
536
+ return node;
529
537
  }
530
538
 
531
539
  /** @private */