fix(datetime): fix overlap in datetime-button modal from datetime being too short#31274
fix(datetime): fix overlap in datetime-button modal from datetime being too short#31274droc101 wants to merge 1 commit into
Conversation
changes min-height of ion-datetime in ion-datetime-button-overlay to 350px from 320px to prevent overlap in months spanning across six weeks in ios mode closes ionic-team#29589
|
@droc101 is attempting to deploy a commit to the Ionic Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
thetaPC
left a comment
There was a problem hiding this comment.
Thanks, this is close. One more case to handle before it is complete.
The iOS scoped min-height fixes the overlap for a plain datetime, but the overlap comes back when the datetime has show-default-title or show-default-buttons (or both). You can reproduce it with a six-week month such as June 2024 and either of those props enabled.
<ion-datetime-button datetime="datetime"></ion-datetime-button>
<ion-modal>
<ion-datetime id="datetime" show-default-title="true" show-default-buttons="true" value="2024-06-13T16:30:00></ion-datetime>
</ion-modal>
| min-height: 350px; | ||
| } |
There was a problem hiding this comment.
Nice work tracking this down. Your diagnosis is correct: the overlap comes from .ion-datetime-button-overlay ion-datetime.datetime-grid overriding the datetime's height, and it undercuts the min-height: 350px that iOS declares for itself in datetime.ios.scss. It looks like a long standing bug rather than an intentional choice.
One refinement before we merge. The current rule applies to every mode, but the overlap is iOS only. In iOS mode the calendar rows are allowed to collapse, so a six-week month gets crammed into the capped height and the day highlights overlap. In MD mode each row cannot shrink below the day size, so the calendar just grows the overlay taller and never overlaps. That means bumping the shared rule to 350px also grows MD overlays that did not need it.
| min-height: 350px; | |
| } | |
| min-height: 320px; | |
| } | |
| /** | |
| * In iOS mode the calendar rows are allowed to collapse, so a month | |
| * spanning six week-rows overlaps the selection highlights when the | |
| * overlay caps the height at 320px. Restore the iOS grid min-height | |
| * (refer to datetime.ios.scss) so six-week months have room. | |
| */ | |
| html.ios .ion-datetime-button-overlay ion-datetime.datetime-grid { | |
| min-height: 350px; | |
| } | |
Issue number: resolves #29589
What is the current behavior?
The
ion-datetime.datetime-gridinside a.ion-datetime-button-overlayis set to be 320px tall instead of the normal 350px. This causes the selection circles in iOS mode to overlap other dates on months that span across six weeks (such as June 2024)What is the new behavior?
ion-datetime.datetime-gridinside.ion-datetime-button-overlayis now 350px tallDoes this introduce a breaking change?