Skip to content

Commit 9ee3a6b

Browse files
committed
fix emoji click disable
1 parent 0695db3 commit 9ee3a6b

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

Sources/EaseChatUIKit/Classes/UI/Components/Chat/Views/MessageInputBar.swift

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -393,32 +393,29 @@ extension MessageInputBar: UITextViewDelegate {
393393
}
394394

395395
public override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
396-
// let convertedPoint = self.convert(point, from: self.superview)
397-
if self.point(inside: point, with: event) {
398-
for view in subviews {
399-
if view.isKind(of: type(of: view)),view.frame.contains(point) {
400-
if view is MessageInputEmojiView, view.isHidden {
401-
if !self.extensionMenus.isHidden {
402-
let childPoint = self.convert(point, to: self.extensionMenus)
403-
let childView = self.extensionMenus.hitTest(childPoint, with: event)
404-
return childView
405-
}
396+
397+
for view in subviews {
398+
if view.isKind(of: type(of: view)),view.frame.contains(point) {
399+
if view is MessageInputEmojiView, view.isHidden {
400+
if !self.extensionMenus.isHidden {
401+
let childPoint = self.convert(point, to: self.extensionMenus)
402+
let childView = self.extensionMenus.hitTest(childPoint, with: event)
403+
return childView
406404
}
407-
if view is MessageInputExtensionView , view.isHidden {
408-
if !(self.emoji?.isHidden ?? true) {
409-
let childPoint = self.convert(point, to: self.emoji)
410-
let childView = self.emoji?.hitTest(childPoint, with: event)
411-
return childView
412-
}
405+
}
406+
if view is MessageInputExtensionView , view.isHidden {
407+
if !(self.emoji?.isHidden ?? true) {
408+
let childPoint = self.convert(point, to: self.emoji)
409+
let childView = self.emoji?.hitTest(childPoint, with: event)
410+
return childView
413411
}
414-
let childPoint = self.convert(point, to: view)
415-
let childView = view.hitTest(childPoint, with: event)
416-
return childView
417412
}
413+
let childPoint = self.convert(point, to: view)
414+
let childView = view.hitTest(childPoint, with: event)
415+
return childView
418416
}
419-
} else {
420-
self.hiddenInput()
421417
}
418+
self.hiddenInput()
422419
self.attachment.isSelected = false
423420
self.emoji?.isHidden = true
424421
self.extensionMenus.isHidden = true

0 commit comments

Comments
 (0)