Skip to content

Commit

Permalink
Fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
thatblindgeye committed Aug 21, 2023
1 parent 6a7cd8a commit 0c901a8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
3 changes: 2 additions & 1 deletion packages/react-core/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ export const Popover: React.FunctionComponent<PopoverProps> = ({
// FocusTrap's initialFocus can accept false as a value to prevent initial focus.
// We want to prevent this in case false is ever passed in.
initialFocus: elementToFocus || undefined,
checkCanFocusTrap: (containers) => new Promise((resolve) => {
checkCanFocusTrap: (containers) =>
new Promise((resolve) => {
const interval = setInterval(() => {
if (containers.every((container) => getComputedStyle(container).visibility !== 'hidden')) {
resolve();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@ import React from 'react';
import { Popover, Button } from '@patternfly/react-core';

export const PopoverCustomFocus: React.FunctionComponent = () => (
<Popover
elementToFocus="#popover-cancel-button"
showClose={false}
aria-label="Popover with custom focus"
headerContent={<div>Popover header</div>}
bodyContent={
<div>
Lorem ipsum dolor sit amet, consectetur adipisicing elit.{' '}
<Button
// Preventing default click behavior for example purposes only
onClick={(event: React.MouseEvent) => event.preventDefault()}
component="a"
isInline
variant="link"
href="#basic"
>
View the basic example
</Button>
</div>
}
footerContent={(hide) => (
<Button onClick={hide} variant="secondary" id="popover-cancel-button">
Cancel
<Popover
elementToFocus="#popover-cancel-button"
showClose={false}
aria-label="Popover with custom focus"
headerContent={<div>Popover header</div>}
bodyContent={
<div>
Lorem ipsum dolor sit amet, consectetur adipisicing elit.{' '}
<Button
// Preventing default click behavior for example purposes only
onClick={(event: React.MouseEvent) => event.preventDefault()}
component="a"
isInline
variant="link"
href="#basic"
>
View the basic example
</Button>
)}
>
<Button>Toggle popover with custom focus</Button>
</Popover>
);
</div>
}
footerContent={(hide) => (
<Button onClick={hide} variant="secondary" id="popover-cancel-button">
Cancel
</Button>
)}
>
<Button>Toggle popover with custom focus</Button>
</Popover>
);

0 comments on commit 0c901a8

Please sign in to comment.