Gutenberg Filtering Metaboxes by Post Format

The problem you are facing is probably that the div (or a parent) gets re-rendered when a change is made in the DOM tree and the handler you assigned to it no longer works. This is because the element you see after the re-render is actually a new one which doesn’t have the handler assigned.

A quick (although not much efficient) fix would be to assign the handler to a parent element that will not be rendered again because it is outside of the react flow. Then use a delegated event to target the control.

$("#wpbody").on("click", "input", function() {
    console.log("input clicked");
});

That said, as far as I understand, the best approach to handle meta data inside Gutenberg is to use the data package and create your own components.