Comments (8)
Once it reaches the maxHeight the textview becomes scrollable. Same way the iMessage app works
from messagekit.
1 minor issue I found with the current inputAccessoryView is that, if you return too many times that the textView expands above the screen top, you cannot scroll to the top of the message ;)
from messagekit.
Yes that is not in the new one I made. There is a maxHeight variable that can be used to correct that
from messagekit.
Cool - or make it scrollable if beyond screen?
from messagekit.
When the textView grows and reaches maxHeight, after sending the message it doesn't go back to the original size.
from messagekit.
Good catch @etoledom . I have isolated the bug to changing the UITextView.isScrollEnabled: Bool
property. For some reason it doesn't let the view resize, possibly due to the auto layout constraints? I am not sure.
This can be corrected by forcing a temp heightAnchor on the InputTextView.
Set the property in setupConstraints(): textViewLayoutSet?.height = textView.heightAnchor.constraint(equalToConstant: 36)
And modify textViewDidChange() to include: textViewLayoutSet?.height?.isActive = textView.text.isEmpty
from messagekit.
Never mind that has bugs, call textView.invalidateIntrinsicContentSize()
in
override open var intrinsicContentSize: CGSize {
let sizeToFit = textView.sizeThatFits(CGSize(width: textView.bounds.width, height: .greatestFiniteMagnitude))
var heightToFit = sizeToFit.height.rounded() + padding.top + padding.bottom + separatorLine.frame.height + tableViewHeightConstant
if heightToFit >= maxHeight {
textView.isScrollEnabled = true
heightToFit = maxHeight
} else {
textView.isScrollEnabled = false
textView.invalidateIntrinsicContentSize()
}
let size = CGSize(width: bounds.width, height: heightToFit)
if previousIntrinsicContentSize != size {
delegate?.inputBar(self, didChangeIntrinsicContentTo: size)
}
previousIntrinsicContentSize = size
return size
}
from messagekit.
Closing this as it is being implemented in #80 👍 Great work @nathantannar4 🎉
from messagekit.
Related Issues (20)
- MessageKit: App freezing Screen when trying to send text long message without any space HOT 1
- How can I make the icon of pdf for Attachments? HOT 5
- Message Collection View Display Problem With Status Bar & Navigation Bar HOT 1
- When mentioning with @ if the username contains space the first name is recognised as the mentioned user.
- Not able to extend the bubble height with func textCellSizeCalculator
- insertmessage not always scrolling to bottom in iOS17 beta HOT 1
- On Copy Action HOT 2
- Cannot remove bottom padding for custom cells
- Does MessageKit have something similar to Message Pinning by IOS?
- Vulnerability Disclosure HOT 5
- Not showing Attributes top, bottom
- How to prevent the input bar from obscuring the scroll indicator?
- Message cell has wrong height when using NSAttributedString constructed from Markdown
- Could not build Objective-C module 'A', 'MessageKit/MessageKit.h' file not found.
- Duration time I stuck to set it
- Introduce PrivacyManifest HOT 4
- scrollToLastItem(at:animated:) is not scrolling to bottom properly. HOT 2
- Scroll up when keyboard appears, only when at the bottom.
- Could not find module 'MessageKit' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator HOT 1
- Text bubbles do not appear! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from messagekit.