Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Theme Block using fixed positioning does not render correctly unless 'reveal sections on scroll' is turned off #3226

Open
MARCA-Charlie opened this issue Jan 31, 2024 · 2 comments

Comments

@MARCA-Charlie
Copy link

Describe the current behavior

Mounting an app block using fixed positioning causes the fixed element to display relative to the app block's section html element and seems to not respect z-index and various other CSS properties.

Describe the expected behavior

The fixed element rendered by the app block should ignore the document flow and not be contained by the HTML element that corresponds to the app block section.

When disabling the 'reveal sections on scroll' setting, the app block elements work as expected.

Version information (Dawn, browsers and operating systems)

  • Dawn Version: 7.0.1
  • Chrome Version 108.0.5359.124
  • macOS Version 13.1

Possible solution

Additional context/screenshots

Code for app block

{%- render 'upsell_popup_styles' -%}
<script src="{{  'upsell_popup_script.js' |  asset_url}}"  ></script>

<div class="marca_atc_modal__backdrop marca_atc_modal__container-display-none" id="marca_atc_modal__container-id">
    <div class="marca_atc_modal__modal-container">
        {% render 'upsell_popup_product_card' %}
    </div>
</div>

<style>

    .marca_atc_modal__container-display-none {
        display: none;
    }

    .marca_atc_modal__backdrop {
        width: 100vw;
        height: 100vh;
        position: fixed!important; 
        top: 0;
        left: 0;
        background-color: rgba(0,0,0,0.5);
        padding: 100px;
        z-index: 1000;
    }

    
    .marca_atc_modal__modal-container {
        background-color: white;
        border-radius: 5px;
        padding: 10px;
        box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
        position: absolute!important;
        z-index: 1001;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        height: 70%;
        width: 70%;
    }

   ...

</style>


{% schema %}
    {
      "name": "Upsell Popup",
      "target": "section"
      
    }
{% endschema %}

Video:
https://github.com/Shopify/dawn/assets/89167030/969ffc4a-6bf3-4b35-946b-f1cc26756709

@MARCA-Charlie
Copy link
Author

@JoshATM

@TheGreatSimo
Copy link

Same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants