Chore: ignore eslint rules in Dropdown/TopNavBarMenu (#59385)

ignore eslint rules in dropdown/topnavbarmenu
This commit is contained in:
Ashley Harrison 2022-11-29 11:13:21 +00:00 committed by GitHub
parent fd39417db5
commit 5011b259c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,11 @@ export const Dropdown = React.memo(({ children, overlay, placement }: Props) =>
{visible && (
<Portal>
<FocusScope autoFocus>
{/*
this is handling bubbled events from the inner overlay
see https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events
*/}
{/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}
<div ref={setTooltipRef} {...getTooltipProps()} onClick={onOverlayClicked}>
<div {...getArrowProps({ className: 'tooltip-arrow' })} />
<CSSTransition

View File

@ -26,6 +26,9 @@ export function TopNavBarMenu({ node: nodePlain }: TopNavBarMenuProps) {
return (
<Menu
header={
// this is needed to prevent bubbling the event to `Menu` and then closing when highlighting header text
// see https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
<div onClick={(e) => e.stopPropagation()} className={styles.header}>
<div>{getNavTitle(node.id) ?? node.text}</div>
{node.subTitle && <div className={styles.subTitle}>{node.subTitle}</div>}