Hi,
I got a strange bug since migrating from Ionic 4 to Ionic 5.
I have a modal with a canvas to draw on pictures. The canvas is fullscreen and there are translucent toolbars in the header and footer. The footer toolbar contains an ion-radio-group and an ion-range.
After each restart of the app, the first time (and only the first time) I enter the page with the canvas, the picture gets displayed wrong. It’s not fullscreen and behind the header and footer is a white background. Then the image is scrollable, what means that the header and footer aren’t overlaping the ion-content. After closing the canvas and reopening it, everything works fine, no matter if it’s a new picture or the same. It only doesn’t work the very first time after closing and opening the app again.
I noticed that this bug only occurs if the ion-range or ion-radio-group are in the header or footer toolbar. If I remove them, everything is fine.
The bug exists in Android and iOS.
With Ionic 4, everything worked as expected, but with Ionic 5 it does not. Is this a bug or am I missing a change from Ionic 4 to Ionic 5?
The template:
<ion-header [className]="drawing === false ? 'toolsVisible' : 'toolsHidden'">
<ion-toolbar>
<ion-buttons slot="start">
<ion-button (click)="saveAndQuit()">
<ion-icon slot="icon-only" name="checkmark"></ion-icon>
</ion-button>
</ion-buttons>
<ion-buttons slot="end">
<ion-button (click)="clearCanvas()">
<ion-icon slot="icon-only" name="refresh"></ion-icon>
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content fullscreen forceOverscroll="false">
<div id="canvas-container">
<canvas #imgCanvas (touchstart)="startDrawing($event)" (touchmove)="moveDrawing($event)" (touchend)="endDrawing()">
</canvas>
</div>
</ion-content>
<ion-footer [className]="drawing === false ? 'toolsVisible' : 'toolsHidden'">
<ion-toolbar>
<ion-row>
<ion-col *ngFor="let color of colors" class="color-block" [style.background]="color" tappable (click)="selectColor(color)"></ion-col>
</ion-row>
<ion-radio-group [(ngModel)]="selectedColor">
<ion-row>
<ion-col *ngFor="let color of colors" class="ion-text-center">
<ion-radio [value]="color"></ion-radio>
</ion-col>
</ion-row>
</ion-radio-group>
<ion-range min="2" max="20" [(ngModel)]="brushSize">
<ion-icon id="thinBrushIcon" slot="start" name="ellipse"></ion-icon>
<ion-icon slot="end" name="ellipse"></ion-icon>
</ion-range>
</ion-toolbar>
</ion-footer>
Left screenshot: First time entering the page --> broken
Right screenshot: Second time entering the page --> working
I tried a few fixes, but nothing worked. I would be very happy, If someone has a clue what the problem is…
1 post - 1 participant
Read full topic