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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors