Skip to content
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

Fix date time bottom spacing on MacOS Safari #146

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

reinink
Copy link
Member

@reinink reinink commented Aug 25, 2023

In Safari on macOS date time inputs that are set to display: block have unexpected extra bottom spacing.

image

This can be corrected by setting the ::-webkit-datetime-edit pseudo-element to display: inline-flex, instead of the browser default of display: inline-block.

I've tested this fix using date, datetime-local and time inputs on the following versions of MacOS Safari. (MacOS Safari currently does not support month or week.)

  • 14.1 (Big Sur)
  • 15.6 (Monterey)
  • 16.5 (Ventura)
  • 17 (Sonoma Beta)

I've also had a look at iOS Safari, but date time inputs render completely different there, so this doesn't have any effect at all in that browser.

Note
This issue was previously not noticeable in our playgrounds since they were running in quirks mode due to the lack of doctype in those demos. I've corrected that, and now this issue is visible in the playground (again, only on MacOS Safari): https://tailwindcss-forms.vercel.app

@vercel
Copy link

vercel bot commented Aug 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tailwindcss-forms ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2023 8:03pm

@reinink reinink merged commit c1c4286 into master Aug 28, 2023
1 check passed
@reinink reinink deleted the fix-date-time-spacing-on-macos-safari branch August 28, 2023 20:37
javierjulio added a commit to activeadmin/activeadmin that referenced this pull request Nov 22, 2023
This resolves a few issues with date inputs on Mac and iOS.

Defaults to left alignment (inherit).

tailwindlabs/tailwindcss-forms#144

Removes top and bottom padding on each of the datetime edit fields so with this the field will now match the same height as other inputs.

tailwindlabs/tailwindcss-forms#146

tailwindlabs/tailwindcss-forms#95

tailwindlabs/tailwindcss-forms#109
javierjulio added a commit to activeadmin/activeadmin that referenced this pull request Nov 22, 2023
This resolves a few issues with date inputs on Mac and iOS.

Defaults to left alignment (inherit).

tailwindlabs/tailwindcss-forms#144

Removes top and bottom padding on each of the datetime edit fields so with this the field will now match the same height as other inputs.

tailwindlabs/tailwindcss-forms#146

tailwindlabs/tailwindcss-forms#95

tailwindlabs/tailwindcss-forms#109
javierjulio added a commit to activeadmin/activeadmin that referenced this pull request Nov 30, 2023
* Add form errors and hints for UI dev

* Use antialiased text on body

* Add radio styles, set base for form controls

* Disable old form SCSS styles

* Add form styles

* Remove old fieldset inputs style

* Remove comment-form fieldset inputs style

This is no longer needed now since we removed the initial selector that added default padding.

* Increase input vertical spacing from 2.5 to 3

Since this adds top and bottom padding, this would be the equal spacing as using gap-6 but using spacing around the container. The overall spacing here is nicer and easier to call out the grouped inputs.

* Add explicit filters, use check_boxes

We need more variety for UI testing so some of these filters instead of select's use check boxes instead.

* Update filter form label style

Use the label class here so when using check boxes for a filter, this only applies to the filter label (group), not the label for each checkbox.

* Remove hard coded space from filter checkbox input

* Add filter form checkboxes style

* Use consistent Sign-In/Out language

This changes "Login" text to "Sign in". We have other places in the locale (links) where we actually use "Sign in" so we should stay consistent. Also apparent with "Log out" instead of "Sign out". Devise is consistent with using both "sign in/out" in its messages so we should be consistent as well.

* Disable old main structure styles

* Add default viewport meta tag for mobile support

Using latest value per HTML5 Boilerplate

https://github.com/h5bp/html5-boilerplate/blob/main/src/index.html

* Permit ngrok-free.app in dev hosts

This is helpful when testing the local dev app on a mobile device.

* Update date input pseudo styles

This resolves a few issues with date inputs on Mac and iOS.

Defaults to left alignment (inherit).

tailwindlabs/tailwindcss-forms#144

Removes top and bottom padding on each of the datetime edit fields so with this the field will now match the same height as other inputs.

tailwindlabs/tailwindcss-forms#146

tailwindlabs/tailwindcss-forms#95

tailwindlabs/tailwindcss-forms#109

* Increase footer top margin

* Remove panel from show page attributes_table

This is redundant with the page title above it. Common to see admins without this redundant title. This makes it better as a default and also to accommodate others that want to customize the layout.

* Devise pages and form actions styles

The form actions styles overlapped with the Devise page updates so I've applied these here. The login button (and for other Devise pages) is full width but because of Formtastic's semantic structure, the actions were laid out horizontally using flex. We only apply flex now if there are multiple actions. This way, on the Devise pages, the action can go full width.

* Update create-another checkbox styles

I prefer the original input+label layout but since Formtastic enforces the nested input within label which we already have styled (despite it being more problematic) this now looks much better.

* Remove columns component

I've decided that there is no point in keeping this and with the move to making the admin more mobile friendly, its just all around easier to replace these with div's and Tailwind classes for the right columns at the right viewport.

* Update blank_slate component

Now just a simple div component with a default CSS class. The content provided can be anything now and isn't built using html_safe, unless given in that form.

* Always use grid for page content container

Even if it's a single column, we always want to use grid here so we can apply the gap if a sidebar is added which is conditional.

* Update templates with Tailwind classes

* Set table actions default style

Easiest to just space these out at the container level for a suitable default.

* Update dropdown styles

This sets the list to a min full width which will at least match the size of the button if the list content is shorter which is often the case with our defaults.

Add a larger shadow to separate popup from content underneath.

Add text color styles to offset the default anchor color.

* Add filter with combined ransack predicate

* Disable more SASS partials that have been migrated

* Disable breadcrumbs SASS (migrated)

This includes an update to a feature test because it was using an old CSS class name for a negated test.

* Disable sortable handle

This no longer works since we removed jQuery UI. Our upgrade guide will call out that has-many-sortable isn't implemented in v4 and will require community contribution.

* Add has-many form styles

* Disable forms SASS partial completely

This has been fully migrated now. From here we can remove sass all together.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant