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(Android): title invisible with searchbar enabled #2456

Merged
merged 4 commits into from
Oct 28, 2024

Conversation

alduzy
Copy link
Member

@alduzy alduzy commented Oct 28, 2024

Description

This PR fixes title being invisible when searchbar is enabled.

In #2395 I added alignItems: 'center' style to the header config component. It aimed to fix iOS subviews floating mid-screen when a larger subview is provided:

(iOS) without alignItems: 'center' (iOS) with alignItems: 'center'
Simulator Screenshot - iPhone 16 Pro - 2024-10-28 at 09 36 53 Simulator Screenshot - iPhone 16 Pro - 2024-10-28 at 09 37 07

This change unintentionally introduced a regression on Android. When searchabar is enabled, the ScreenStackHeaderConfig components height is equal 0 and it does not 'stretch' to accomodate the native title. Simple solution is to center align the subviews depending on the Platform.

(Android) with alignItems: 'center' (Android) without alignItems: 'center'
Screenshot_1730106776 Screenshot_1730106784

Changes

  • updated Test2395.tsx repro
  • center aligning items conditionally based on Platform

Test code and steps to reproduce

  • use Test2395.tsx repro

Checklist

  • Included code example that can be used to test this change
  • Ensured that CI passes

@alduzy alduzy requested review from maciekstosio and kkafar October 28, 2024 09:16
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

My initial question 👇🏻

src/components/ScreenStackHeaderConfig.tsx Outdated Show resolved Hide resolved
@alduzy alduzy requested a review from kkafar October 28, 2024 10:50
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

Yeah, we might be better off with this approach.

src/components/ScreenStackHeaderConfig.tsx Show resolved Hide resolved
@kkafar
Copy link
Member

kkafar commented Oct 28, 2024

Note: line of comment and link to the PR might be useful somewhere close to these styles. Otherwise this code is unreadable.

@alduzy alduzy merged commit d33687e into main Oct 28, 2024
3 checks passed
@alduzy alduzy deleted the @alduzy/title-with-searchbar-layout-fix branch October 28, 2024 12:17
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.

3 participants