Skip to content

Commit 0a480d4

Browse files
committed
Fixed attempt to call .some() on DomTokenList, which isn't an array
1 parent b5e1155 commit 0a480d4

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/components/Modal/Modal.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,12 @@ class Modal extends Component<Props, State> {
120120
if (allowClose) this.handleClose(event);
121121
};
122122
handleBackdropClick = (event: MouseEvent) => {
123-
const hasBackdropClassName = event.target.classList.some(className =>
124-
backdropClassNames.has(className),
125-
);
123+
let hasBackdropClassName = false;
124+
for (const targetClass of event.target.classList) {
125+
if (backdropClassNames.has(targetClass)) {
126+
hasBackdropClassName = true;
127+
}
128+
}
126129

127130
if (!hasBackdropClassName || !this.props.closeOnBackdropClick) {
128131
return;

0 commit comments

Comments
 (0)