Files
react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h
T
Samuel Susla e98a835bfc Fix default value for scrollView.contentInsetAdjustmentBehavior
Summary:
Changelog: [internal]

The dafault UIKit value of `UIScrollView.contentInsetAdjustmentBehavior` is automatic. Fabric had incorrect value never.

source: https://developer.apple.com/documentation/uikit/uiscrollview/2902261-contentinsetadjustmentbehavior?language=objc

This was causing bug for one navigation library that's migrating to Fabric: https://github.com/reactwg/react-native-new-architecture/discussions/43#discussioncomment-2885450

Reviewed By: javache

Differential Revision: D37881453

fbshipit-source-id: 290ae428a720f00ed61f2a3e5c2c9bbf54e1ac6e
2022-07-15 06:42:50 -07:00

78 lines
2.2 KiB
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <react/renderer/components/scrollview/primitives.h>
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
namespace facebook {
namespace react {
// TODO (T28334063): Consider for codegen.
class ScrollViewProps final : public ViewProps {
public:
ScrollViewProps() = default;
ScrollViewProps(
const PropsParserContext &context,
ScrollViewProps const &sourceProps,
RawProps const &rawProps);
void setProp(
const PropsParserContext &context,
RawPropsPropNameHash hash,
const char *propName,
RawValue const &value);
#pragma mark - Props
bool alwaysBounceHorizontal{};
bool alwaysBounceVertical{};
bool bounces{true};
bool bouncesZoom{true};
bool canCancelContentTouches{true};
bool centerContent{};
bool automaticallyAdjustContentInsets{};
bool automaticallyAdjustsScrollIndicatorInsets{true};
Float decelerationRate{0.998f};
bool directionalLockEnabled{};
ScrollViewIndicatorStyle indicatorStyle{};
ScrollViewKeyboardDismissMode keyboardDismissMode{};
Float maximumZoomScale{1.0f};
Float minimumZoomScale{1.0f};
bool scrollEnabled{true};
bool pagingEnabled{};
bool pinchGestureEnabled{true};
bool scrollsToTop{true};
bool showsHorizontalScrollIndicator{true};
bool showsVerticalScrollIndicator{true};
Float scrollEventThrottle{};
Float zoomScale{1.0f};
EdgeInsets contentInset{};
Point contentOffset{};
EdgeInsets scrollIndicatorInsets{};
Float snapToInterval{};
ScrollViewSnapToAlignment snapToAlignment{};
bool disableIntervalMomentum{false};
std::vector<Float> snapToOffsets{};
bool snapToStart{true};
bool snapToEnd{true};
ContentInsetAdjustmentBehavior contentInsetAdjustmentBehavior{
ContentInsetAdjustmentBehavior::Automatic};
bool scrollToOverflowEnabled{false};
#pragma mark - DebugStringConvertible
#if RN_DEBUG_STRING_CONVERTIBLE
SharedDebugStringConvertibleList getDebugProps() const override;
#endif
};
} // namespace react
} // namespace facebook