Coder Social home page Coder Social logo

Comments (3)

liamdebeasi avatar liamdebeasi commented on April 28, 2024 1

Thanks for the report. Buttons take on additional styles when they are used inside of a toolbar. When keep-contents-mounted is set, the button is rendered inside of a toolbar (even if it's not a child of the toolbar). The button should have an in-toolbar class which applies the special styles.

When keep-contents-mounted is not set, the button is not rendered until the modal is moved to the root of the application. As a result, the button is never rendered inside of the toolbar.

The class is not re-evaluated every time the button moves around in the DOM as that would introduce a performance overhead.

Can you try moving the modal outside of the toolbar and let me know if that resolves the issue?

from ionic-framework.

liamdebeasi avatar liamdebeasi commented on April 28, 2024 1

As long as the modal is outside of the toolbar that should be enough to avoid this behavior. You can keep the modal inside of ion-page if you'd like. The modal has display: none when closed so it should not impact layout.

from ionic-framework.

SpaceTimee avatar SpaceTimee commented on April 28, 2024

Yes, both buttons are rendered normally when moving the modals outside of the toolbar

Is it advised to put modals outside the ion-page like this?

<template>
  <ion-page>
    <ion-header>
      <ion-toolbar>
        <ion-buttons>
          <ion-button id="normal-ion-modal-trigger">Normal</ion-button>
          <ion-button id="kept-ion-modal-trigger">Kept</ion-button>
        </ion-buttons>
      </ion-toolbar>
    </ion-header>
  </ion-page>

  <ion-modal trigger="normal-ion-modal-trigger">
    <ion-button>Normal</ion-button>
  </ion-modal>

  <ion-modal trigger="kept-ion-modal-trigger" keep-contents-mounted>
    <ion-button>Kept</ion-button>
  </ion-modal>
</template>

from ionic-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.