Comments (3)
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.
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.
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)
- ion-radio no longer selectable from clicking anywhere inside an ion-item HOT 3
- feat: Lifecycle events not working on IonNav components HOT 10
- bug(refresher): mode does not account for child pages with global mode set HOT 4
- bug: Custom CSS Properties Not Applying to ion-input with "fill" Attribute HOT 7
- bug: Overlays now have aria-hidden=true when displaying a Toast HOT 4
- bug: Capacitor compose 1.5 to 1.6 HOT 4
- bug: modal is not consistently shifted upwards when keyboard is shown on ipad HOT 2
- bug: ion select shadow dom lable can not be used in angular HOT 2
- bug: ion-modal .modal-shadow z-index override not applying HOT 2
- bug: Click event on ion-item fires twice when ion-input is inside HOT 1
- bug: virtual prop mode does not account if assigned dynamically for all components HOT 1
- bug: in IonRouterOutlet types does not follow the proper type documentation HOT 11
- bug: Lifecycle hook not firing when going to non tabs page and coming back. HOT 5
- bug: IonTabButton doesn't have default HTML event attributes typed HOT 1
- bug: ion-backdrop visible=false not working HOT 2
- bug: IonRouterOutlet missing the properties onPointerEnterCapture, onPointerLeaveCapture HOT 5
- bug: Angular 17 and Ionic 7 - SSR issue HOT 4
- bug: IonRouterOutlet | Type '{ children: Element[]; }' is missing the following properties from type 'Pick<IonRouterOutlet & { basePath?: string | undefined; ref?: Ref<any> | undefined; ionPage?: boolean | undefined; } & IonicReactProps & Omit<...>, keyof IonicReactProps | ... 253 more ... | "ionPage">': onPointerEnterCapture, HOT 2
- bug: Filled Input changing the centered vertically of label when switch font-family css HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-framework.