Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Textview is behind the keyboard #615

Closed
1 task
ShawnBaek opened this issue Aug 12, 2017 · 13 comments · May be fixed by #652
Closed
1 task

Textview is behind the keyboard #615

ShawnBaek opened this issue Aug 12, 2017 · 13 comments · May be fixed by #652

Comments

@ShawnBaek
Copy link

ShawnBaek commented Aug 12, 2017

  • [v ] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [v ] I've read and agree to the Code of Conduct.
  • [ v] I've searched for any related issues and avoided creating a duplicate issue.

Description

TextView is behind keyboard.

Reproducible in:

  • This is reproducible in the sample project.
    SlackTextViewController version:
    iOS version(s): 10.3
    Device(s): iphone 6

Actual result:

When I tapped the textView then keyboard showing up. but textview is hidden.

related #605 problem

Attachments:

2017-08-12 8 19 26

@johndoehelloworld
Copy link

+1

@ShawnBaek
Copy link
Author

@johndoehelloworld I solved this problem. Override ViewDidAppear Func will affect this issue. Remove ViewDidAppear func in ViewController. But I don't know why this func affect this library.

@johndoehelloworld
Copy link

@ShawnBaek : I tried it, but it still doesn't want to work correctly all the time. Are you trying by bringing up the keyboard in your simulator? And every single time, you are seeing that input bar stays on top of the keyboard? In my case, most times the input bar is hidden, but sometimes, it does stick to the top of the keyboard. Thoughts?

@tditchek
Copy link

tditchek commented Nov 9, 2017

@ShawnBaek This issue is happening for me on iOS 11.0.3 with an iPhone 6. I've also tested it on an iPhone X and an iPhone 8 Plus.

I have not overridden viewDidAppear in that view controller. Is this issue being addressed? If not, is there any other workaround you know of?

@brod-ie
Copy link

brod-ie commented Nov 10, 2017

@ShawnBaek I can confirm this is happening on an iPhone 8 on iOS 11.1 without a view did appear override, please reopen the issue
simulator screen shot - iphone 8 - 2017-11-10 at 08 05 34

@brod-ie
Copy link

brod-ie commented Nov 13, 2017

@ShawnBaek @tditchek Did you find anything?

@tditchek
Copy link

@brod-ie Nothing yet. As far as I can tell, issue #605 is the cause, but I haven't been able to figure out a workaround yet. I cloned the repo to try to play around and see if I can figure out a fix but I'm not as advanced with Objective-C as I am with Swift so I'm having some trouble fixing it on my own.

@brod-ie
Copy link

brod-ie commented Nov 13, 2017

@tditchek Thanks for the update, I also tried self.presentKeyboard() and super.presentKeyboard() to no luck until after view had appeared. Perhaps the keyboard show/hide notifications aren't bound until that event 🤔

@tditchek
Copy link

@brod-ie I added a fix to my forked SlackTextViewController project and it seems to work just fine now. I've submitted a pull request with the changes, but until @dzenbot approves it you can feel free to use my fork or inspect the above commit to add the changes locally on your own. good luck!

@brod-ie
Copy link

brod-ie commented Nov 15, 2017

@tditchek Just used the fork and still no luck. When are you firing textView.becomeFirstResponder(), viewDidLoad/viewWillAppear/viewDidAppear? Or are you using presentKeyboard()?

@tditchek
Copy link

tditchek commented Nov 16, 2017

@brod-ie I'm not explicitly firing textView.becomeFirstResponder() or presentKeyboard(). I'm using the built-in tap gesture recognizer on the text view and it's working just fine. In fact, I'm not programmatically setting the first responder anywhere in that screen. The keyboard is now pushing the textView up above it as it's supposed to. See the attached screenshot:

screen shot 2017-11-16 at 1 34 19 pm

@brod-ie
Copy link

brod-ie commented Nov 17, 2017

@tditchek By "built-in tap gesture recognizer on the text view" do you mean you're not automatically showing the keyboard on load/appear, but are letting the user tap in themselves? Or are you programmatically triggering that gesture recogniser? If so, how? Thanks 😊

@tditchek
Copy link

tditchek commented Nov 17, 2017

@brod-ie My use case required allowing the user to tap it on their own, but for argument's sake I just tried to add a viewDidAppear method with textView.becomeFirstResponder() inside and it worked just fine. Since I use cocoapods to manage my dependencies, I'm using my personal fork of the SlackTextViewController until @dzenbot or somebody else reviews my PR. If you're using cocoapods you can add it like this:

pod 'SlackTextViewController', :git => 'https://github.com/tditchek/SlackTextViewController', :branch => 'master'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants