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

Review use of abortSignal in events listener patterns. #1877

Closed
1 task done
Westbrook opened this issue Oct 21, 2021 · 0 comments
Closed
1 task done

Review use of abortSignal in events listener patterns. #1877

Westbrook opened this issue Oct 21, 2021 · 0 comments
Labels
Discovery enhancement New feature or request

Comments

@Westbrook
Copy link
Contributor

Code of conduct

  • I agree to follow this project's code of conduct.

Description of issue

Can whatwg/dom#911 be leveraged along the lines of:

const ac = new AbortController();
let { signal } = ac;
parentElement.addEventListener(
    'pointerenter',
    this.openOverlay,
    { signal }
);
parentElement.addEventListener('focusin', this.openOverlay, { signal });
parentElement.addEventListener(
    'pointerleave',
    this.closeOverlay,
    { signal }
);
parentElement.addEventListener('focusout', this.closeOverlay, { signal });
ac.abort();

To simplify events being added/removed from elements imperatively.

Things to confirm:

  • does the abortController really work across multiple listeners?
  • does Safari support it broadly enough to allow in the library?
  • does it have undesired perf costs?
  • others?
@Westbrook Westbrook added the enhancement New feature or request label Oct 21, 2021
@Westbrook Westbrook closed this as not planned Won't fix, can't repro, duplicate, stale Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discovery enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants