Forum Discussion

DavidAnthony's avatar
DavidAnthony
Helper II
1 year ago
Solved

How to Display a Dropdown Menu Outside the Frame of a Custom Visual in Power BI?

Hi everyone,
I'm developing a custom visual in Power BI and would like to display a dropdown menu (or a div) outside the frame of the visual, as shown in the attached image. I've tried a few approaches, but I haven't been successful so far. Has anyone done this before and can guide me on how to achieve it? I'm using the Power BI Visuals API for development. Any help would be greatly appreciated!

Thanks

  • Hi DavidAnthony,

     

    If you're using a rich component that requires custom HTML and JS behaviors, then these are clipped by the iframe sandbox, and you need to size the visual accordingly to make space for them.

     

    Sandboxed iframes are a little more forgiving with native HTML form elements like <select/>, and these can overflow the container boundaries, e.g.:

     

     

    The downsides are that native HTML elements are limited in their styling and functionality, which is why many alternatives exist. Modern browsers have since worked to improve the styling options which can help if your reasons and some UI frameworks have some nice component wrappers for the native select element (e.g., Fluent UI).

     

    Regards,

     

    Daniel

2 Replies

  • dm-p's avatar
    dm-p
    Super User

    Hi DavidAnthony,

     

    If you're using a rich component that requires custom HTML and JS behaviors, then these are clipped by the iframe sandbox, and you need to size the visual accordingly to make space for them.

     

    Sandboxed iframes are a little more forgiving with native HTML form elements like <select/>, and these can overflow the container boundaries, e.g.:

     

     

    The downsides are that native HTML elements are limited in their styling and functionality, which is why many alternatives exist. Modern browsers have since worked to improve the styling options which can help if your reasons and some UI frameworks have some nice component wrappers for the native select element (e.g., Fluent UI).

     

    Regards,

     

    Daniel