How to deal with the problem of modal Anti-penetration

There is a picture and button on the

page. The mouse scrolls to zoom the picture. Click the button to open the modal box. Mode box is the table that can be scrolled, when the mouse scrolls, the contents of the table scroll at the same time, the picture will also be zoomed, how to solve this situation? The mode box is the modal component in antd design


this is a rolling traversal problem. The community has proposed many solutions


personal idea is to limit containers for scrolling events


closelayer (e) {

var el1 = event.currentTarget;
var el2 = event.target;
if (el1 == el2) {
  //do something
}

}
el1 is the click object
el2 is the target

Menu