Calling event.stopPropagation inside the portal can prevent the event from reaching parent React handlers.