Closed mmdock closed 3 years ago
Hey @mmdock thank you for raising this issue.
In my project after sending a message all I'm calling is invalidatePlugins()
and invalidateIntrinsicContentSize()
on messageInputBar: InputBarAccessoryView
. Could you try to call this to fix your issue? Attachments container sizing is working properly for me with these methods
@martinpucik will give it a look today. I know I am calling invalidatePlugins already, but not sure about InvalidateIntrinsicContentSize().
@martinpucik forgot to mention, adding invalidateIntrinsicContentSize()
to the end of my setAttachmentManager(active:)
function was what was missing. thanks for the help!
thank you! calling invalidateIntrinsicContentSize()
also helped for me!
Describe the bug I am sending a image and loading the image into the attachment manager before sending. After it is sent, the InputBarAccessoryView is still quite a bit taller.
To Reproduce Steps/code to reproduce the behavior:
DemoCode: For complete demo, see patch file here: file.txt (This is actually a git
.patch
but github doesn't support adding a .patch file. So rename to file.patch and apply to MessageKit/master. I wrote this patch off of commitae53cdd
if that also helps)General overview: Manage attachment manager as such:
Make button and apply to left stack view:
Expected behavior I expect the InputBarAccessoryView topStackView to return to a height of 0 after sending image and removing attachmentManager's attachmentView.
Note: This issue only seems to occur if the left stack items are too tall. If I change:
$0.setSize(CGSize(width: 42, height: 42), animated: false)
to$0.setSize(CGSize(width: 38, height: 38), animated: false)
it works as expected. It fails to behave correctly for any values >= 39 for the size.Screenshots
With the second screenshot, it is hard to tell, but the topStackView ends right below the typing indicator
Environment
Additional context Note: if you use Xcode 12, you will need to update PINRemoteImage to 3.0.1 which I did not include in the patch in order to streamline to prevent the PINRemoteImage Xcode 12 compilation issue. As such, someone should update to the example to use that asap (it's in their master branch but they haven't yet updated Cocoapods.)