Skip to main content
sekeidesign
Apr 7, 2021 2:53 PM UTC
Question

Is there any way to change the "z-index" of an auto-layout child?

I’m using auto-layout for this modal, just like I do for pretty much everything else, and I’m creating a modal, with a text field, and a dropdown.
The dropdown should float above the buttons, and I’d prefer to do this with auto-layout. (I know I could use an overlay, it would be nice to control the z-index somehow though)

    This topic has been closed for replies.

    35 replies

    James_Mitchell
    Dec 18, 2021 9:19 AM UTC

    @Bobby_Spiecher I combined the steps of your hack into a plugin you so you can do it in one step now.

    Same wonky solution so not ideal but at least it’s faster.

    Figma
    Joachim_Pihlgren
    New Member
    Jan 26, 2022 9:20 AM UTC

    I agree, we need to be able to manually adjust the z-index of layers without interfering with the order they are laid out.

    [Usecase]: In my case I have an autolayouted frame which holds three layers, one of which contains a child which overflows the parent. This represents a dropdown menu being active which should not push content downards.

    Chris_Obermiller
    Feb 18, 2022 12:13 AM UTC

    This is the way

    Omer_Demirsoy
    Mar 10, 2022 11:30 AM UTC

    Yeah, here is another need 😦. That can be similar as “fix scroll” usage maybe.

    Zach_Ward1
    New Member
    Mar 28, 2022 2:55 PM UTC

    There’s actually an easier way to do this reversal “hack”… Simply select the auto layout frame you wish to reverse and manually drag the top adjustment handle of the frame past the bottom of the frame to its same height.

    That being said, @Figma_Support can we please get confirmation that you’ve seen this issue and are taking the step to build a feature that allows this z-index reversal? This hack breaks the auto layout by reversing the entire frame. Thus we cannot build components which have predictable overrides.

    Nicolas_De_Wolf
    New Member
    Jun 28, 2022 1:33 PM UTC

    Same problem on my side and I can’t delete my auto-layout because it will break the interaction of my prototype. Is there still no solution to keep using auto layout and force a certain z-index?

    Simon_Steer
    Jun 28, 2022 2:03 PM UTC

    Not sure if anyone in this thread is still stuck trying to figure out how to achieve this, but you might have some luck by editing the “advanced layout” settings and change the canvas stacking setting to “first on top”, which essentially will reverse the z-index priority of the items in your auto layout frame:

    Pete10
    Jul 26, 2022 1:28 AM UTC

    This worked. Cheers Bobby

    Daniel80
    Jul 27, 2022 10:55 PM UTC

    Thank you! You’re a hero.

    Raja_Naseem
    Aug 18, 2022 10:28 AM UTC

    This Really Worked <3