Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
maxkuzmin
Regular Visitor

Visual.update() not triggered when switching between tabs

I created two tabs and placed on each of them https://github.com/microsoft/PowerBI-visuals-ChicletSlicer. When the first tab is loaded, Visual.update is called. When I switch to the second tab, it is also called. But when I switch back to the first tab again, Visual.update is not called and the view is empty. The same happens if I switch back to the second tab. If I resize the page, Visual.update is called and suddenly the tab is not empty anymore. This issue is reproducible with any custom view; I use this one just for isolating the issue.

3 REPLIES 3
maxkuzmin
Regular Visitor

I steel need help with that issue

Anonymous
Not applicable

Hi @maxkuzmin ,

Base on your description, it sounds like the 'Visual.update' method is not being triggered consistently when tabs are switched, leading to empty views unless the page is resized. You can force an update on tab switch using JavaScript in your application:

$(document).ready(function () {
    $('ul.tabs li').click(function () {
        var tab_id = $(this).attr('data-tab');

        $('ul.tabs li').removeClass('current');
        $('.tab-content').removeClass('current');

        $(this).addClass('current');
        $("#" + tab_id).addClass('current');

        // Force update the visual, for example by resizing
        window.dispatchEvent(new Event('resize'));
    });
});

In addition, Chiclet Slicer is a custom visual. You can try to raise one ticket in Github and get a dedicated support.

Issues · microsoft/PowerBI-visuals-ChicletSlicer · GitHub

Best Regards

Thank you for your response and the suggestion to use JavaScript to trigger a resize event. After further consideration, it appears that this issue is related to Power BI's handling of report-level tab switches rather than the custom visual itself.

Given that developers of custom visuals do not have direct control over report-level events or tab switches, implementing a JavaScript resize event as a workaround isn't feasible in this context. The problem with the Visual.update() method not being triggered on tab switches seems to be a systemic issue within Power BI.

As such, it would be more appropriate to recognize this as a potential bug or limitation of the Power BI platform. Could you please escalate this issue to the Power BI development team for further investigation and a more robust solution? This would ensure that the platform handles these events correctly and improves overall functionality for all users.

Thank you for your understanding and assistance.

 

Screenshot 2024-06-25 at 04.47.18.png

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.