• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

adobe / spectrum-web-components / 14094674923

26 Mar 2025 10:27PM UTC coverage: 86.218% (-11.8%) from 98.002%
14094674923

Pull #5221

github

web-flow
Merge 2a1ea92e7 into 3184c1e6a
Pull Request #5221: RFC | leverage css module imports in components

1737 of 2032 branches covered (85.48%)

Branch coverage included in aggregate %.

14184 of 16434 relevant lines covered (86.31%)

85.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

52.94
/tools/shared/src/first-focusable-in.ts
1
/*
14✔
2
Copyright 2020 Adobe. All rights reserved.
14✔
3
This file is licensed to you under the Apache License, Version 2.0 (the "License");
14✔
4
you may not use this file except in compliance with the License. You may obtain a copy
14✔
5
of the License at http://www.apache.org/licenses/LICENSE-2.0
14✔
6

14✔
7
Unless required by applicable law or agreed to in writing, software distributed under
14✔
8
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14✔
9
OF ANY KIND, either express or implied. See the License for the specific language
14✔
10
governing permissions and limitations under the License.
14✔
11
*/
14✔
12

14✔
13
import type { SpectrumElement } from '@spectrum-web-components/base';
14✔
14
import { userFocusableSelector } from './focusable-selectors.js';
14✔
15

14✔
16
export const firstFocusableIn = (
14✔
17
    root: HTMLElement | ShadowRoot
×
18
): SpectrumElement | null => {
×
19
    const firstFocusable = root.querySelector(
×
20
        userFocusableSelector
×
21
    ) as SpectrumElement;
×
22
    return firstFocusable;
×
23
};
×
24

14✔
25
export const firstFocusableSlottedIn = (
14✔
26
    root: HTMLSlotElement
×
27
): SpectrumElement | null => {
×
28
    const firstFocusable = root
×
29
        .assignedElements()
×
30
        .find((element) =>
×
31
            element.matches(userFocusableSelector)
×
32
        ) as SpectrumElement;
×
33
    return firstFocusable;
×
34
};
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc