[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16696425#comment-16696425 ] ASF GitHub Bot commented on WEEX-434: - wqyfavor closed pull request #1297: [WEEX-434][iOS] Fix the input cannot move down to original position.… URL: https://github.com/apache/incubator-weex/pull/1297 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm index d4f2488558..b8b27c312b 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm @@ -73,6 +73,9 @@ @interface WXEditComponent() // disable move rootView up as the keyboard show up. @property (nonatomic, assign) BOOL disableMoveViewUp; +// avoid keyboardWillHide executes twice +@property (nonatomic, assign) BOOL keyboardHidden; + @end @implementation WXEditComponent @@ -98,6 +101,7 @@ - (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDict _returnEvent = NO; _clickEvent = NO; _keyboardEvent = NO; +_keyboardHidden = YES; // handle attributes _autofocus = [attributes[@"autofocus"] boolValue]; _disabled = [attributes[@"disabled"] boolValue]; @@ -220,6 +224,7 @@ -(void)focus -(void)blur { if(self.view) { +[[NSNotificationCenter defaultCenter] postNotificationName:UIKeyboardWillHideNotification object:nil]; [self.view resignFirstResponder]; } } @@ -659,7 +664,7 @@ - (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); +CGFloat offset = inputFrame.origin.y-(rootViewFrame.size.height-_keyboardSize.height-inputFrame.size.height) + 20; if (offset > 0) { rect = (CGRect){ .origin.x = 0.f, @@ -889,11 +894,13 @@ - (void)keyboardWasShown:(NSNotification*)notification if (_keyboardEvent) { [self fireEvent:@"keyboard" params:@{ @"isShow": @YES }]; } + +_keyboardHidden = NO; } - (void)keyboardWillHide:(NSNotification*)notification { -if (![self.view isFirstResponder]) { +if (![self.view isFirstResponder] || _keyboardHidden) { return; } if (!_disableMoveViewUp) { @@ -906,10 +913,13 @@ - (void)keyboardWillHide:(NSNotification*)notification if (_keyboardEvent) { [self fireEvent:@"keyboard" params:@{ @"isShow": @NO }]; } + +_keyboardHidden = YES; } - (void)closeKeyboard { +[[NSNotificationCenter defaultCenter] postNotificationName:UIKeyboardWillHideNotification object:nil]; [self.view resignFirstResponder]; } This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: acton393 >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16525293#comment-16525293 ] ASF GitHub Bot commented on WEEX-434: - Github user weifengsmile closed the pull request at: https://github.com/apache/incubator-weex/pull/1239 > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16525237#comment-16525237 ] ASF GitHub Bot commented on WEEX-434: - Github user weifengsmile commented on the issue: https://github.com/apache/incubator-weex/pull/1239 ok, but you should pay attention to the different offset between iOS 10 and iOS 11, and there is also different offset between iPhone X and other iPhones. @wqyfavor > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16524690#comment-16524690 ] ASF GitHub Bot commented on WEEX-434: - Github user wqyfavor commented on the issue: https://github.com/apache/incubator-weex/pull/1239 @weifengsmile Please close your PR. I created another one and is a little different from yours. https://github.com/apache/incubator-weex/pull/1297 Your fix cannot work in Playground. So I add 20px to offset directly. > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16524668#comment-16524668 ] ASF GitHub Bot commented on WEEX-434: - Github user weex-bot commented on the issue: https://github.com/apache/incubator-weex/pull/1297 Messages :book: has no jsfm file changed. :book: jsfm test finished. Generated by :no_entry_sign: http://github.com/danger/danger-js/;>dangerJS > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16524664#comment-16524664 ] ASF GitHub Bot commented on WEEX-434: - GitHub user wqyfavor opened a pull request: https://github.com/apache/incubator-weex/pull/1297 [WEEX-434][iOS] Fix the input cannot move down to original position.… … Also fix issue that keyboard covers part of input when there is no navigation bar. First of all, thank you for your contribution! Please makes sure that these checkboxes are checked before submitting your PR, thank you! CheckList: **if** *isBugFix* **:** * [ ] Make sure that you add at least one unit test for the bug which you had fixed. **elif** *isNewFeature* **:** * [ ] Update API docs for the component. * [ ] Update/Add demo to demonstrate new feature. * [ ] Update test scripts for the feature. * [ ] Add unit tests for the feature. You can merge this pull request into a Git repository by running: $ git pull https://github.com/wqyfavor/incubator-weex fix-keyboard Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-weex/pull/1297.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1297 commit 155238dc970c1a53e546a94b35ef6839b1971026 Author: 神漠 Date: 2018-06-27T05:36:35Z [WEEX-434][iOS] Fix the input cannot move down to original position. Also fix issue that keyboard covers part of input when there is no navigation bar. > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16523812#comment-16523812 ] ASF GitHub Bot commented on WEEX-434: - Github user weifengsmile commented on the issue: https://github.com/apache/incubator-weex/pull/1239 This is the iOS xcode project: [ios-issue.zip](https://github.com/apache/incubator-weex/files/2137558/ios-issue.zip) And this issue can not be reproduced in the playground, it is different from simulator and real device. You can try it in simulator or real device. @wqyfavor > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16523108#comment-16523108 ] ASF GitHub Bot commented on WEEX-434: - Github user wqyfavor commented on the issue: https://github.com/apache/incubator-weex/pull/1239 Please provide your xcode project. I really cannot reproduce. I don't know the differences between playground and your app. Or you may use playground or Taobao app to scan your bundle and to see if this issue can reproduce. @weifengsmile > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16523089#comment-16523089 ] ASF GitHub Bot commented on WEEX-434: - Github user weifengsmile commented on the issue: https://github.com/apache/incubator-weex/pull/1239 iOS 11.1, and the weexSDK version is the latest version in pods. I didn't use the playground app, this is the result from iOS simulator, and there is the same issue in real device. > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16522503#comment-16522503 ] ASF GitHub Bot commented on WEEX-434: - Github user weifengsmile commented on the issue: https://github.com/apache/incubator-weex/pull/1239 ``` The environment is ready! export default { name: 'App', data () { return { } } } .input { background-color: #ff; margin-top: 300px; width: 300px; height: 80px ; padding: 20px; color: #00; } .wrapper { justify-content: center; align-items: center; background-color: #88; } .greeting { text-align: center; margin-top: 70px; font-size: 50px; color: #41B883; } ``` ![code](https://user-images.githubusercontent.com/11461723/41863121-69cd58a8-78d8-11e8-8ce7-a7f76d524f58.png) It is very simple. You can check the image: ![init page](https://user-images.githubusercontent.com/11461723/41862867-aa59713c-78d7-11e8-9dad-6877993b6422.png) ![the input component focus](https://user-images.githubusercontent.com/11461723/41862893-bec067fc-78d7-11e8-8f60-bec52a5b506e.png) ![the keyboard dismiss](https://user-images.githubusercontent.com/11461723/41862922-d794a9fa-78d7-11e8-8ec3-d86d5405a552.png) **Issue 1: The WXRootView cannot reset to original position.** **Issue 2: The keyboards cover a apart of the input component.** @wqyfavor > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16521045#comment-16521045 ] ASF GitHub Bot commented on WEEX-434: - Github user wqyfavor commented on the issue: https://github.com/apache/incubator-weex/pull/1239 Please provide the page source. I put an edit at the bottom of a page but cannot reproduce this issue. @weifengsmile > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1655#comment-1655 ] ASF GitHub Bot commented on WEEX-434: - Github user weex-bot commented on the issue: https://github.com/apache/incubator-weex/pull/1239 Messages :book: has no jsfm file changed. :book: jsfm test finished. Generated by :no_entry_sign: http://github.com/danger/danger-js/;>dangerJS > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WEEX-434) WXRootView cannot reset to original position
[ https://issues.apache.org/jira/browse/WEEX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1648#comment-1648 ] ASF GitHub Bot commented on WEEX-434: - GitHub user weifengsmile opened a pull request: https://github.com/apache/incubator-weex/pull/1239 [WEEX-434][iOS] fix the input cannot move down to original position a… …nd the toolbar of keyboard cover the input component when on bottom First of all, thank you for your contribution! Please makes sure that these checkboxes are checked before submitting your PR, thank you! CheckList: **if** *isBugFix* **:** * [ ] Make sure that you add at least one unit test for the bug which you had fixed. **elif** *isNewFeature* **:** * [ ] Update API docs for the component. * [ ] Update/Add demo to demonstrate new feature. * [ ] Update test scripts for the feature. * [ ] Add unit tests for the feature. You can merge this pull request into a Git repository by running: $ git pull https://github.com/weifengsmile/incubator-weex iOS-bugfix-input-moveup Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-weex/pull/1239.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1239 commit 6722bd8bfc8d52fc0fcc6e9b3993017efa8d4a31 Author: Sidney Li Date: 2018-06-04T10:02:28Z [WEEX-434][iOS] fix the input cannot move down to original position and the toolbar of keyboard cover the input component when on bottom > WXRootView cannot reset to original position > > > Key: WEEX-434 > URL: https://issues.apache.org/jira/browse/WEEX-434 > Project: Weex > Issue Type: Bug > Components: iOS >Reporter: weifengsmile >Assignee: xingZhang >Priority: Major > Attachments: 屏幕快照 2018-06-04 下午5.28.47.png, 屏幕快照 2018-06-04 > 下午5.29.09.png, 屏幕快照 2018-06-04 下午5.30.43.png > > > Reproduce condition: the input component is on the bottom of page. > When the input component moved up as keyboard shown, the keyboard > Preselection view or toolbar view will cover a part of the input component. > And WXRootView cannot move to original position after keyboard hiden. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)