Don't initiate table view cell drag while user is selecting poll options

This commit is contained in:
Shadowfacts 2021-06-12 19:22:51 -04:00
parent 130da9d4cc
commit 4f2f8d517f
2 changed files with 8 additions and 1 deletions

View File

@ -33,6 +33,10 @@ class StatusPollView: UIView {
private var animator: UIViewPropertyAnimator! private var animator: UIViewPropertyAnimator!
private var currentSelectedOptionIndex: Int! private var currentSelectedOptionIndex: Int!
var isTracking: Bool {
optionsView.isTracking
}
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()

View File

@ -326,8 +326,11 @@ extension TimelineStatusTableViewCell: TableViewSwipeActionProvider {
extension TimelineStatusTableViewCell: DraggableTableViewCell { extension TimelineStatusTableViewCell: DraggableTableViewCell {
func dragItemsForBeginning(session: UIDragSession) -> [UIDragItem] { func dragItemsForBeginning(session: UIDragSession) -> [UIDragItem] {
// the poll options view is tracking while the user is dragging between options
// while that's happening, don't initiate a drag
guard let status = mastodonController.persistentContainer.status(for: statusID), guard let status = mastodonController.persistentContainer.status(for: statusID),
let accountID = mastodonController.accountInfo?.id else { let accountID = mastodonController.accountInfo?.id,
!pollView.isTracking else {
return [] return []
} }
let provider = NSItemProvider(object: status.url! as NSURL) let provider = NSItemProvider(object: status.url! as NSURL)