Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] fix the offset error of textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
jianhan-he committed Aug 19, 2019
1 parent f3c3c17 commit a7d6d3a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,8 @@ - (void)setViewMovedUp:(BOOL)movedUp
CGRect rootViewFrame = rootView.frame;
CGRect inputFrame = [self.view.superview convertRect:self.view.frame toView:rootView];
if (movedUp) {
CGFloat offset = inputFrame.origin.y-(rootViewFrame.size.height-_keyboardSize.height-inputFrame.size.height) + _upriseOffset;
CGFloat inputOffset = inputFrame.size.height - (rootViewFrame.size.height - inputFrame.origin.y);
CGFloat offset = inputFrame.origin.y-(rootViewFrame.size.height-_keyboardSize.height- (inputOffset > 0 ? inputFrame.size.height - inputOffset : inputFrame.size.height)) + _upriseOffset;
if (offset > 0) {
rect = (CGRect){
.origin.x = 0.f,
Expand Down

0 comments on commit a7d6d3a

Please sign in to comment.