-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[Fabric] iOS: Fixes textinput onscroll event payload #43445
Conversation
@sammy-SC has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
/rebase |
44961bc
to
91dd672
Compare
payload.setProperty(runtime, "layoutMeasurement", layoutMeasurement); | ||
} | ||
|
||
payload.setProperty(runtime, "zoomScale", textInputMetrics.zoomScale ?: 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this check needed? Isn't zoomScale always set from Objective-C?
If is isn't, wouldn't it be better to assign a default value to zoomScale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just kept the same as Old arch
react-native/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.mm
Line 58 in 082decb
@"zoomScale" : @(scrollView.zoomScale ?: 1), |
zoomScale
should be 1.0
, and we think 0
is a invalid value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's fair. Thanks for the clarification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you! I just one small question but that isn't blocking.
Summary: Fixes #43428 . cc cortinico . ## Changelog: [IOS] [FIXED] - [Fabric] iOS: Fixes textinput onscroll event payload Pull Request resolved: #43445 Test Plan: ``` const onInputScroll = (e) => { if (Platform.OS !== "web") { const { nativeEvent: { contentOffset: { x, y }, }, } = e; console.log('onInputScroll ====', e?.nativeEvent) } }; <TextInput onScroll={onInputScroll} // ref={inputRef} multiline /> ``` Reviewed By: cortinico Differential Revision: D54813378 Pulled By: sammy-SC fbshipit-source-id: 76671fbb390c2fbc67a9c29b6c2a834ba699fff4
Summary:
Fixes #43428 . cc @cortinico .
Changelog:
[IOS] [FIXED] - [Fabric] iOS: Fixes textinput onscroll event payload
Test Plan: