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

Fixed Issue #6966 [Status bar overlap on iPads using Tailwind CSS] #7310

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Xeno-Tek
Copy link

Fix: Status Bar Overlap on iPads

Overview

This pull request resolves an issue where content overlaps with the status bar on iPad devices. The fix utilizes Tailwind CSS classes to account for the status bar height and safe area insets on iPads without affecting other devices.

Related Issue

Closes #6966

Changes

tailwind.config.cjs

  • Added iPad-specific breakpoints.
  • Introduced a new spacing value ipad-status-bar for the iPad status bar height.

App.tsx

  • Updated the main container to include ipad:pt-ipad-status-bar, adding proper top padding on iPads.

Header.tsx

  • Adjusted the header component to account for the status bar on iPads using iPad-specific Tailwind classes.

Screenshots

iPad 10th Generation (Portrait)

iPad 10th Generation (Landscape)

iPhone 16 Pro Max

iPhone SE 3rd Generation

iPad Pro 13-inch (M4)

Testing

  • Verified that the status bar no longer overlaps with content on iPad devices.
  • Tested in both portrait and landscape orientations on iPads.
  • Ensured the header and main content are properly positioned below the status bar on iPads.
  • Used only Tailwind CSS classes for styling adjustments.

@Xeno-Tek
Copy link
Author

@VIKTORVAV99,
I've implemented the changes using Tailwind CSS to address the status bar overlap issue. Please let me know If this works.

@VIKTORVAV99
Copy link
Member

@Xeno-Tek are those new screenshots?
They still show that the map is not behind the status bar / safe area. Which we wanted to keep.

@Xeno-Tek
Copy link
Author

@VIKTORVAV99 Thanks for pointing that out! I initially thought it was acceptable for the map not to overlay the safe area insets, but I've gone ahead and adjusted it as per your feedback. The map now correctly overlays the safe area insets.

  1. Updated main.tsx:
    • Added CSS variables for safe area insets.
    • Created new utility classes for extending content to the top edge and handling content within safe areas.
    • Added padding to the root element to account for the safe area top inset.
  2. Modified MapWrapper.tsx:
    • Added the extend-to-top-edge class to the map container div to allow it to extend behind the status bar.
  3. Updated ZoomControls.tsx:
    • Implemented dynamic top margin calculation based on the safe area top inset.
    • Used a useEffect hook to update the top margin on component mount and window resize.

Preview Images

iPad 10th Generation (Portrait)

iPad 10th Generate Fix safe area overlap

iPad 10th Generation (Landscape)

iPad 10th gen fix horizontaly

iPhone 16 Pro Max

Iphone 16  Pro Max fix

iPhone SE 3rd Generation

Iphone SE 3rd gen fix

iPad Pro 13-inch M4

iPad Pro 13-inch M4

Copy link
Member

@VIKTORVAV99 VIKTORVAV99 left a comment

Choose a reason for hiding this comment

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

While this seems to work it does this by adding duplicate styles which will be hard to debug later.

There is also files changed in this PR that should not be changed at all which needs to be cleaned up before merging.

web/src/main.tsx Outdated Show resolved Hide resolved
web/src/main.tsx Outdated Show resolved Hide resolved
mockserver/package-lock.json Outdated Show resolved Hide resolved
mobileapp/ios/App/Podfile.lock Outdated Show resolved Hide resolved
web/src/features/map-controls/ZoomControls.tsx Outdated Show resolved Hide resolved
web/src/features/map-controls/ZoomControls.tsx Outdated Show resolved Hide resolved
web/src/features/map/MapWrapper.tsx Outdated Show resolved Hide resolved
Podfile.lock: Removed empty space at line 16.

ZoomControls.tsx: Using CSS marginTop instead of UseEffect().

Map.tsx: Added inset: 0, marginTop: 'calc(var(--sat) * -1)' to the style instead of creating element for Map.
@Xeno-Tek
Copy link
Author

@VIKTORVAV99 Ive made the changes according to your feedback, please check the files changed.

Test Results After Implementation of Changes

iPad 10th Gen - Portrait Mode

iPad 10th Gen Portrait Mode

iPad 10th Gen - Landscape Mode

iPad 10th Gen Landscape Mode

iPhone 16 Pro Max

iPhone 16 Pro Max

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

Successfully merging this pull request may close these issues.

iOS header overlaps with UI
2 participants