-
Notifications
You must be signed in to change notification settings - Fork 347
Prevent date inputs shifting alignment on iOS 18 #6454
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
Open
querkmachine
wants to merge
1
commit into
main
Choose a base branch
from
fix-date-input-alignment-ios18
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+11
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stylesheets changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
index 741b02be4..2f6332e72 100644
--- a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
+++ b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
@@ -2700,7 +2700,8 @@ screen and (forced-colors:active) {
.govuk-date-input__item {
display: inline-block;
margin-right: 20px;
- margin-bottom: 0
+ margin-bottom: 0;
+ vertical-align: bottom
}
.govuk-date-input__label {
Action run for 84cc312 |
Other changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/components/date-input/_index.scss b/packages/govuk-frontend/dist/govuk/components/date-input/_index.scss
index 43d1bc7c6..38c670858 100644
--- a/packages/govuk-frontend/dist/govuk/components/date-input/_index.scss
+++ b/packages/govuk-frontend/dist/govuk/components/date-input/_index.scss
@@ -14,6 +14,11 @@
display: inline-block;
margin-right: govuk-spacing(4);
margin-bottom: 0;
+
+ // Prevents an issue in iOS Safari 18 where the items vertically
+ // shift when the value of inputs is changed.
+ // https://github.com/alphagov/reported-bugs/issues/90
+ vertical-align: bottom;
}
.govuk-date-input__label {
Action run for 84cc312 |
364422e to
9cf64ea
Compare
9cf64ea to
ae1071d
Compare
📋 StatsNo changes to any distributed file sizes! Action run for 84cc312 |
3 tasks
Contributor
|
Thanks @querkmachine I've snagged this (co-author credit) for NHS.UK frontend too Much appreciated |
Member
Author
|
Not sure why the Heroku deployment is failing. Investigating... Edit: Info here - #6455 |
Due to an upstream issue in Safari on iOS 18 (and potentially 17), the box model calculations for these inputs go iffy when the value is deleted and re-typed. The upstream issue was reported during the beta period of iOS 26 and fixed in the release of iOS 26 in September, however no fix for older versions seems to be coming, so we should prevent the issue in our own code in the meantime. NHS.UK Frontend issue: nhsuk/nhsuk-frontend#1227 Our bug report: alphagov/reported-bugs#90
ae1071d to
84cc312
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Due to an upstream issue in Safari on iOS 18 (and potentially iOS 17), the box model calculations for children of the Date input component go a bit wrong when an input's value is deleted and re-typed.
The issue was reported to the WebKit team during the beta period of iOS 26 and fixed before the final release of iOS 26 in September, however no fix for older versions of iOS has yet happened nor appears to be coming, so we should prevent the issue in our own code until iOS 18 has fallen out of browsers we support.
The specific fix is the one suggested by @colinrotherham in the NHS.UK Frontend issue: nhsuk/nhsuk-frontend#1227 (comment)
Closes #5861.
Changes
vertical-alignrule to items within the Date input component.