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

fix(overlay): only "tab trap" when you mean to #885

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

Westbrook
Copy link
Contributor

Description

Safari has issues with WebGL canvas in association with out tab trapping solution. This mitigated the issue by initializing the tab trapping approach only when tab trapping is being used by an element.

I have another idea that is low touch that I want to try, but all of my other ideas in this area haven't been working, so having something proposed as a possible path forward feels nice...

Related Issue

refs #848

Motivation and Context

You should be able to have WebGL canvas AND use SWC.

How Has This Been Tested?

  • exiting tests pass.

Types of changes

  • refactor

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@@ -90,6 +90,11 @@ export class OverlayStack {
}

private startTabTrapping(): void {
if (!this.trappingInited) {
this.initTabTrapping();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might work a little better to have a disableTabTrapping option. I'd rather not cause all clients to do extra work if they're not running into the Safari issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the boolean check, I don't particularly count this as extra work. I had previously been making this call in the constructor() which means if an application doesn't use tab trapping this change now means they do less work.

A universal disabledTabTrapping options is interesting, however. Where do you think you'd want to apply that? Currently, there are no packages that leverage tab trapping on their own (IIRC), so an implementing app could also not use type="modal" (or manage their own usage of that value) and this would never be needed in that application.

This does point to the benefit of a more durable solution. To prevent such a solution from adding work to non-Safari browsers, what are you thoughts on in component browser checking?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh never mind -- I just misunderstood this logic. I'm not even sure how 🙈. This looks perfect.

Copy link
Collaborator

@adixon-adobe adixon-adobe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome -- thanks!

@Westbrook Westbrook marked this pull request as ready for review September 15, 2020 14:43
@Westbrook Westbrook merged commit 74e1bd2 into main Sep 15, 2020
@Westbrook Westbrook deleted the westbrook/overlay-safari branch September 15, 2020 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants