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

feat(useActiveElement): support shadow roots #2592

Merged
merged 2 commits into from Jan 3, 2023

Commits on Dec 30, 2022

  1. feat (core): support shadow roots in useActiveElement

    Assuming you have a DOM structure like so:
    
    ```
    body
      my-element
        #shadow-root
          input
    ```
    
    When the `input` becomes active, the outer document's `activeElement`
    will actually be `my-element`, _not_ the input.
    
    Each shadow root has its own `activeElement` in case you want to get
    hold of the inner element in these cases.
    
    This adds support to `useActiveElement` such that you can pass a shadow
    root as the document to observe the active element of.
    43081j committed Dec 30, 2022
    Copy the full SHA
    d3ac60e View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2023

  1. chore: update

    antfu committed Jan 3, 2023
    Copy the full SHA
    fbae8e1 View commit details
    Browse the repository at this point in the history