Drupal 8 JS event after opening AJAX modal
Drupal provides a few custom events for AJAX modals. Even though the modal itself is provided by jQuery UI library, these events are custom and are provided by Drupal itself.
There are a few events you can use here: