How to catch the admin tab switching event in Magento 2

- Magento 2

Magento 2 Development

Since Magento 2 utilizes the standard jQuery UI Tabs Widget, you should catch the tabsactivate event to catch the admin tab switching:

$textarea.closest(‘.ui-tabs-panel’).get(0) is a tab you should handle.

data.newPanel.get(0) is the one that becomes active.

Source

More tips from the Cookbook