-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save and restore state of focus #35
base: main
Are you sure you want to change the base?
Conversation
package.json
Outdated
@@ -38,20 +38,20 @@ | |||
} | |||
], | |||
"devDependencies": { | |||
"@logux/eslint-config": "^53.2.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this changes since they break CI (also each PR should be focused on a single thing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I apologize for the changes added to the commit due to inattention
We need to fix CI: fix tests and update |
Hi. Sorry for my disappearance for a month Notes and questions related to the test update:
|
Maybe you forgot to push it? There are no changes in PR https://github.com/ai/keyux/pull/35/files Or what is the question?
You need to add new Then you need to emulate user interactions with DOM API.
console.log(node.innerHTML)
Maybe it is because of pnpm bnt or even: node --test --import tsx --enable-source-maps
Feel free to ask extra question if you want to go deeper (or if I didn’t understand you correctly). |
Hi. Done! Waiting for your review! |
@@ -53,14 +71,21 @@ export function jumpKeyUX() { | |||
}, 50) | |||
} | |||
|
|||
function restoreFocus(event) { | |||
event.preventDefault() | |||
lastFocusedElement.focus({ focusVisible: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if it was deleted from DOM?
Hi Andrey,
Sorry for the delay.
I've implemented what was described in the last comment of the PR #33 discussion : #33 (comment)
Current PR also is related to issue #32.
Screencast:
Screencast.from.2024-08-23.23-13-36.mp4