Skip to content

feat: add support for headers and change the layout approach #199

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Cyberax
Copy link

@Cyberax Cyberax commented Jul 9, 2025

This commit adds support for header components. However, the major improvement is the changed approach to doing the layout for the bottom sheet.

Prior to this commit, there was an inherent conflict between the native iOS/Android layout systems and the React layout manager. In particular, this resulted in issues with the on-screen keyboard overlapping controls.

To solve this, this commit introduces an intermediate view that sits between the native OS dialog and the hosted React view. This intermediate view handles the keyboard avoidance using OS-specific mechanism: keyboardLayoutGuide on iOS and rootView.padding on Android.

We then communicate the visible area back to React that then lays out components as usual. So there is no need to have special handling for scrolling views or to do manual footer positioning.

Copy link

vercel bot commented Jul 9, 2025

@Cyberax is attempting to deploy a commit to the Jovanni's projects Team on Vercel.

A member of the Team first needs to authorize it.

});
exports.TrueSheetHeader = void 0;
var _jsxRuntime = require("react/jsx-runtime");
const TrueSheetHeader = props => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

"use strict";

import { jsx as _jsx } from "react/jsx-runtime";
export const TrueSheetHeader = props => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

Component?: TrueSheetProps['HeaderComponent']
}

export const TrueSheetHeader = (props: TrueSheetHeaderProps) => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.


val data = Arguments.createMap()
data.putDouble("width", Utils.toDIP(rect.width().toFloat()).toDouble())
data.putDouble("height", Utils.toDIP(rect.height().toFloat()).toDouble())
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

val rect = sheetDialog.getVisibleContentDimensions()

val data = Arguments.createMap()
data.putDouble("width", Utils.toDIP(rect.width().toFloat()).toDouble())
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

Copy link

codeclimate bot commented Jul 9, 2025

Code Climate has analyzed commit 7bbb440 and detected 13 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Duplication 12

View more on Code Climate.

This commit adds support for header components. However, the major
improvement is the changed approach to doing the layout for the bottom
sheet.

Prior to this commit, there was an inherent conflict between the native
iOS/Android layout systems and the React layout manager. In particular,
this resulted in issues with the on-screen keyboard overlapping
controls.

To solve this, this commit introduces an intermediate view that sits
between the native OS dialog and the hosted React view. This
intermediate view handles the keyboard avoidance using OS-specific
mechanism: keyboardLayoutGuide on iOS and rootView.padding on Android.

We then communicate the visible area back to React that then lays out
components as usual. So there is no need to have special handling for
scrolling views or to do manual footer positioning.
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