Skip to content

Switch to actually-Safari-specific CSS hack for iOS temporal input fix#18816

Merged
cvrebert merged 1 commit intov4-devfrom
fix-17308
Jan 11, 2016
Merged

Switch to actually-Safari-specific CSS hack for iOS temporal input fix#18816
cvrebert merged 1 commit intov4-devfrom
fix-17308

Conversation

@cvrebert
Copy link
Collaborator

@cvrebert cvrebert commented Jan 9, 2016

Fixes #17308.
Research backing up this hack: http://browserbu.gs/css-hacks/webkit-full-page-media/

Chrome screenshot with the patch applied (temporal inputs are no longer super-tall):
chrome

iOS 9 Safari screenshot with the patch applied (text in temporal inputs is still vertically centered (at least by eyeball)):


The heights of datetime-local date, month, week, and time inputs in Chrome now become 40px, which is still different from the 38px height of the other textual inputs, but that particular discrepancy isn't caused by the iOS CSS that we're fixing here. Will open a new issue for that.

There is some slight redundancy in the generated selectors, but it doesn't affect the potency of the hack. Here's what I mean:

_::-webkit-full-page-media.input-lg,
.input-group-lg _::-webkit-full-page-media.form-control,
input[type="date"].input-lg,
...

I couldn't find a way in Sass, when nesting is involved, to tack a selector onto a selector list without it getting cross-producted with the nestees. Perhaps there's some particular Sass judo I don't know about.

CC: @mdo

@cvrebert cvrebert added this to the v4.0.0-alpha.3 milestone Jan 9, 2016
scss/_forms.scss Outdated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selector _ should be written in lowercase with hyphens

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tweaked the SCSS-Lint config to squelch this. It was trying to enforce the dash-separated-words naming convention on element names in addition to class names.

@cvrebert
Copy link
Collaborator Author

cvrebert commented Jan 9, 2016

This hit a minor SCSS-Lint bug. Opened a PR to fix it: sds/scss-lint#672

@cvrebert cvrebert force-pushed the fix-17308 branch 2 times, most recently from 0e44c77 to 126f94e Compare January 9, 2016 09:23
@mdo
Copy link
Member

mdo commented Jan 11, 2016

Wow, awesome hack if it works. Mad props for spending time on this dude.

…nment of temporal input text in iOS Safari

See http://browserbu.gs/css-hacks/webkit-full-page-media/
Fixes #17308

[skip sauce]
[skip validator]
@cvrebert
Copy link
Collaborator Author

Added a lint exemption comment to work around the SCSS-Lint bug.

cvrebert added a commit that referenced this pull request Jan 11, 2016
Switch to actually-Safari-specific CSS hack for iOS temporal input fix
@cvrebert cvrebert merged commit cbc71dc into v4-dev Jan 11, 2016
@cvrebert cvrebert deleted the fix-17308 branch January 11, 2016 02:38
@patrickhlauke
Copy link
Member

Confirming that this also fixes the issue in Edge (and the inputs are exactly the same height as other text inputs)

capture

@cvrebert
Copy link
Collaborator Author

The heights of datetime-local, date, month, week, and time inputs in Chrome now become 40px, which is still different from the 38px height of the other textual inputs, but that particular discrepancy isn't caused by the iOS CSS that we're fixing here. Will open a new issue for that.

Filed #18842.

@cvrebert
Copy link
Collaborator Author

Also, turns out OS X Safari is (still) bugged: #18843

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants