Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/visual-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'vaadin'
container:
image: mcr.microsoft.com/playwright:v1.56.0-noble
image: mcr.microsoft.com/playwright:v1.59.1-noble
options: --ipc=host

steps:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'vaadin'
container:
image: mcr.microsoft.com/playwright:v1.56.0-noble
image: mcr.microsoft.com/playwright:v1.59.1-noble
options: --ipc=host

steps:
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'vaadin'
container:
image: mcr.microsoft.com/playwright:v1.56.0-noble
image: mcr.microsoft.com/playwright:v1.59.1-noble
options: --ipc=host

steps:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"typescript": "^5.9.3"
},
"resolutions": {
"playwright": "^1.56.0"
"playwright": "^1.59.1"
},
"lint-staged": {
"*.{js,ts}": [
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/dashboard/src/vaadin-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
let wrappers = [...hostElement.children].filter((el) => el.localName === WRAPPER_LOCAL_NAME);

const focusedWrapper = wrappers.find((wrapper) => wrapper.querySelector(':focus'));
const focusedElement = focusedWrapper && focusedWrapper.querySelector(':focus');

Check warning on line 269 in packages/dashboard/src/vaadin-dashboard.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer using an optional chain expression instead, as it's more concise and easier to read.

See more on https://sonarcloud.io/project/issues?id=vaadin_web-components&issues=AZ1i02w-HStcVu6PHDhL&open=AZ1i02w-HStcVu6PHDhL&pullRequest=11450
const focusedWrapperWillBeRemoved = focusedWrapper && !this.__isActiveWrapper(focusedWrapper);
const wrapperClosestToRemovedFocused =
focusedWrapperWillBeRemoved && this.__getClosestActiveWrapper(focusedWrapper);
Expand Down Expand Up @@ -313,6 +314,9 @@
if (focusedWrapperWillBeRemoved) {
// The wrapper containing the focused element was removed. Try to focus the element in the closest wrapper.
this.__focusWrapperContent(wrapperClosestToRemovedFocused || this.querySelector(WRAPPER_LOCAL_NAME));
} else if (focusedElement && !focusedElement.matches(':focus')) {
// Firefox may lose focus from an element when a sibling DOM element is removed. Restore it.
focusedElement.focus();
}

const focusedItem = this.querySelector(':focus');
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 14 additions & 5 deletions packages/grid/test/keyboard-interaction-mode.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,31 +529,40 @@
// Focus the input on the first row
focusFirstBodyInput(0);

const tabToIndex = 20;
const tabToIndex = 10;

async function rendered() {
await nextFrame();
await nextRender();
await nextFrame();
}

// Get the row containing the focused element by walking up the DOM,
// crossing slot boundaries via assignedSlot. Uses getDeepActiveElement()
// to handle Firefox where document.activeElement returns the shadow host.
function getFocusedItemRowIndex() {

Check warning on line 543 in packages/grid/test/keyboard-interaction-mode.test.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Move function 'getFocusedItemRowIndex' to the outer scope.

See more on https://sonarcloud.io/project/issues?id=vaadin_web-components&issues=AZ1m4EvuKxecox-xophd&open=AZ1m4EvuKxecox-xophd&pullRequest=11450
let el = getDeepActiveElement();
while (el && !(el instanceof HTMLTableRowElement)) {
el = el.assignedSlot ? el.assignedSlot.parentElement : el.parentElement;
}
return el ? el.index : -1;
}

// Tab downwards
for (let i = 1; i <= tabToIndex; i++) {
await rendered();
await sendKeys({ press: 'Tab' });
await rendered();

const focusedRow = document.activeElement.parentElement.assignedSlot.parentElement.parentElement;
expect(focusedRow.index).to.equal(i);
expect(getFocusedItemRowIndex()).to.equal(i);
}

// Tab upwards
for (let i = tabToIndex - 1; i >= 0; i--) {
await rendered();
await sendKeys({ press: 'Shift+Tab' });
await rendered();
const focusedRow = document.activeElement.parentElement.assignedSlot.parentElement.parentElement;
expect(focusedRow.index).to.equal(i);
expect(getFocusedItemRowIndex()).to.equal(i);
}
});
});
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8446,17 +8446,17 @@ pkg-dir@^4.2.0:
dependencies:
find-up "^4.0.0"

playwright-core@1.56.0:
version "1.56.0"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.56.0.tgz#14b40ea436551b0bcefe19c5bfb8d1804c83739c"
integrity sha512-1SXl7pMfemAMSDn5rkPeZljxOCYAmQnYLBTExuh6E8USHXGSX3dx6lYZN/xPpTz1vimXmPA9CDnILvmJaB8aSQ==
playwright-core@1.59.1:
version "1.59.1"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.59.1.tgz#d8a2b28bcb8f2bd08ef3df93b02ae83c813244b2"
integrity sha512-HBV/RJg81z5BiiZ9yPzIiClYV/QMsDCKUyogwH9p3MCP6IYjUFu/MActgYAvK0oWyV9NlwM3GLBjADyWgydVyg==

playwright@^1.53.0, playwright@^1.56.0:
version "1.56.0"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.56.0.tgz#71c533c61da33e95812f8c6fa53960e073548d9a"
integrity sha512-X5Q1b8lOdWIE4KAoHpW3SE8HvUB+ZZsUoN64ZhjnN8dOb1UpujxBtENGiZFE+9F/yhzJwYa+ca3u43FeLbboHA==
playwright@^1.53.0, playwright@^1.59.1:
version "1.59.1"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.59.1.tgz#f7b0ca61637ae25264cec370df671bbe1f368a4a"
integrity sha512-C8oWjPR3F81yljW9o5OxcWzfh6avkVwDD2VYdwIGqTkl+OGFISgypqzfu7dOe4QNLL2aqcWBmI3PMtLIK233lw==
dependencies:
playwright-core "1.56.0"
playwright-core "1.59.1"
optionalDependencies:
fsevents "2.3.2"

Expand Down
Loading