Disable auto close in WordPress mobile navigation

When developing a WordPress site it can be difficult to inspect an open mobile navigation if it keeps closing when it loses focus. This will remove that functionality. I recommend only using it during development and then removing this code prior to launch:

add_filter('render_block_core/navigation', function ($block_content, $block) {
    $tags = new WP_HTML_Tag_Processor($block_content);
    if($tags->next_tag(array('class_name' => 'wp-block-navigation__responsive-container'))) {
        $tags->remove_attribute('data-wp-on-async--focusout');
        return $tags->get_updated_html();
    }
    return $block_content;
}, 10, 2);