Skip to content
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

Create commands for remembering and restoring the tab and focused element #84

Open
david-tejada opened this issue Feb 21, 2023 · 0 comments
Labels

Comments

@david-tejada
Copy link
Owner

This would be useful to use in conjunction with the vscode draft functionality. One of the issues that arises when using this functionality is that you open another tab and when you go to submit it fails because the tab where you originally use the draft command is not the active one.

The commands could be something like this:

  • rememberActiveElement: Stores the tab and active element in that tab.
  • restoreActiveElement: It makes the stored tab the active one and restores the focus to the proper active element.

I need to take into account that the active element could be in a frame different than the main one. I think the simplest approach is to send the command to all the frames but in the frame only store the active element if it's not an iframe element. When the command to restore the active element is issued I again send the command to all frames but only restore the focus if the storedActiveElement is not undefined.

I also need to take into account if the active element is a shadow host to retrieve the active element of the shadow root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant