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

textkernel / oneui / 11774677434

11 Nov 2024 08:16AM CUT coverage: 89.083%. Remained the same
11774677434

Pull #1305

github

web-flow
Merge 8d745996e into ef88a3194
Pull Request #1305: chore(deps): update eslint

1387 of 1773 branches covered (78.23%)

Branch coverage included in aggregate %.

3411 of 3613 relevant lines covered (94.41%)

60.62 hits per line

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

28.57
/src/components/Dropdown/DropdownSubContent/DropdownSubContent.tsx
1
import React, { useEffect } from 'react';
5✔
2
import { SubContent, DropdownMenuSubContentProps } from '@radix-ui/react-dropdown-menu';
5✔
3
import { bem } from '../../../utils/bem/bem';
5✔
4
import styles from '../Dropdown.scss';
5✔
5

6
interface Props extends DropdownMenuSubContentProps {
7
    /** Ref element used to make the width of the Subcontent equal to the parent width */
8
    refElement?: React.RefObject<HTMLElement | null>;
9
}
10

11
const { block } = bem('DropdownSubContent', styles);
5✔
12

13
export const DropdownSubContent = React.forwardRef<HTMLElement, Props>(
5✔
14
    ({ refElement, ...rest }, ref) => {
×
15
        const [width, setWidth] = React.useState<number>();
×
16

17
        useEffect(() => {
×
18
            if (refElement?.current?.offsetWidth) {
×
19
                setWidth(refElement.current.offsetWidth);
×
20
            }
21
        }, [refElement, width]);
22

23
        return (
×
24
            <SubContent
25
                ref={ref}
26
                {...rest}
27
                {...block(rest)}
28
                sideOffset={6}
29
                style={{ minWidth: width }}
30
            />
31
        );
32
    }
33
);
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