We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5e1155 commit 0a480d4Copy full SHA for 0a480d4
1 file changed
src/components/Modal/Modal.js
@@ -120,9 +120,12 @@ class Modal extends Component<Props, State> {
120
if (allowClose) this.handleClose(event);
121
};
122
handleBackdropClick = (event: MouseEvent) => {
123
- const hasBackdropClassName = event.target.classList.some(className =>
124
- backdropClassNames.has(className),
125
- );
+ let hasBackdropClassName = false;
+ for (const targetClass of event.target.classList) {
+ if (backdropClassNames.has(targetClass)) {
126
+ hasBackdropClassName = true;
127
+ }
128
129
130
if (!hasBackdropClassName || !this.props.closeOnBackdropClick) {
131
return;
0 commit comments