From e5b81c8cec4c872d638676dedbe0fbe232d235b6 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sun, 6 Oct 2024 23:10:59 +0200 Subject: [PATCH] [modal] Fix comment location (#44026) --- docs/data/base/components/modal/UseModal.js | 6 ------ docs/data/base/components/modal/UseModal.tsx | 6 ------ packages/mui-base/src/Modal/Modal.tsx | 6 ------ packages/mui-base/src/unstable_useModal/useModal.ts | 6 ++++++ packages/mui-joy/src/Drawer/Drawer.tsx | 6 ------ packages/mui-joy/src/Modal/Modal.tsx | 6 ------ packages/mui-material/src/Modal/Modal.js | 6 ------ packages/mui-material/src/Modal/useModal.ts | 6 ++++++ 8 files changed, 12 insertions(+), 36 deletions(-) diff --git a/docs/data/base/components/modal/UseModal.js b/docs/data/base/components/modal/UseModal.js index b35a6642a33844..02be482df395da 100644 --- a/docs/data/base/components/modal/UseModal.js +++ b/docs/data/base/components/modal/UseModal.js @@ -118,12 +118,6 @@ const Modal = React.forwardRef(function Modal(props, forwardedRef) { return ( - {/* - * Marking an element with the role presentation indicates to assistive technology - * that this element should be ignored; it exists to support the web application and - * is not meant for humans to interact with directly. - * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md - */} {!hideBackdrop ? : null} - {/* - * Marking an element with the role presentation indicates to assistive technology - * that this element should be ignored; it exists to support the web application and - * is not meant for humans to interact with directly. - * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md - */} {!hideBackdrop ? : null} (function Modal< return ( - {/* - * Marking an element with the role presentation indicates to assistive technology - * that this element should be ignored; it exists to support the web application and - * is not meant for humans to interact with directly. - * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md - */} {!hideBackdrop && BackdropComponent ? : null} - {/* - * Marking an element with the role presentation indicates to assistive technology - * that this element should be ignored; it exists to support the web application and - * is not meant for humans to interact with directly. - * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md - */} {!hideBackdrop ? : null} - {/* - * Marking an element with the role presentation indicates to assistive technology - * that this element should be ignored; it exists to support the web application and - * is not meant for humans to interact with directly. - * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md - */} {!hideBackdrop ? : null} - {/* - * Marking an element with the role presentation indicates to assistive technology - * that this element should be ignored; it exists to support the web application and - * is not meant for humans to interact with directly. - * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md - */} {!hideBackdrop && BackdropComponent ? ( diff --git a/packages/mui-material/src/Modal/useModal.ts b/packages/mui-material/src/Modal/useModal.ts index 9aca8a03c46a18..4cb2b992beae60 100644 --- a/packages/mui-material/src/Modal/useModal.ts +++ b/packages/mui-material/src/Modal/useModal.ts @@ -179,6 +179,12 @@ function useModal(parameters: UseModalParameters): UseModalReturnValue { }; return { + /* + * Marking an element with the role presentation indicates to assistive technology + * that this element should be ignored; it exists to support the web application and + * is not meant for humans to interact with directly. + * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md + */ role: 'presentation', ...externalEventHandlers, onKeyDown: createHandleKeyDown(externalEventHandlers),