-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Bring the preview tab to the front when clicking the preview button. #9015
Conversation
Duplicates #8446 |
oups :) |
Can you elaborate on this? Is this intended to bring the tab to the front? I was under the impression this wouldn't be possible, but if |
Yes, exactly. I assume we need to test in several browsers, but yeah it works |
I mean, even if it doesn't work, it could be considered an enhancement for those which do. I assumed it wasn't possible. The Classic Editor, for example, often loads to an existing tab but doesn't shift focus when saving. Maybe we could reopen this one and repurpose it toward just that change? |
So this seems to work only on Chrome for me but doesn't break other browsers, so yeah. Progressive Enhancement. |
If this works only in Chrome, as you say, we should leave a comment explaining that, because otherwise this might come across as quite the bug. Would be a good candidate for an e2e test too, especially as the behaviour is only present in Chrome ^_^ |
I love progressive enhancement. But is there any way to know if this is, you know, a web standard? Is this Chrome being early in implementing a feature, or is it Chrome being Chrome? If it's a feature that should eventually trickle out to other browsers, ship it. But otherwise, probably good to generally try and avoid platform lockin. |
73b131a
to
a9a1591
Compare
It looks like this is standard but it's configurable by the user in the browser settings. I guess browser have different default values for these options https://developer.mozilla.org/en-US/docs/Web/API/Window/focus |
The related specification is an interesting read as well:
https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus Effectively, this is one of those things where it's left to the browser to decide how to implement, but the intent of the change is to indicate that the tab is intended to be brought to the forefront (whether this actually occurs or some other indicator of intent like flashing, etc). |
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.
With #8446 being merged, I'm not sure whether to expect there's still changes shown for adding the || this.previewWindow.closed
, but otherwise this looks good 👍
a9a1591
to
0065ce9
Compare
Testing instructions