From 888d2a1408b92d084cca1072220945f73a2fa2e8 Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 6 Jul 2021 17:06:39 +0800 Subject: [PATCH] fix: custom emoji picker not cancel when switch input. resolve #199 --- Mastodon/Scene/Compose/ComposeViewController.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Mastodon/Scene/Compose/ComposeViewController.swift b/Mastodon/Scene/Compose/ComposeViewController.swift index 55ad0816c..63799ae78 100644 --- a/Mastodon/Scene/Compose/ComposeViewController.swift +++ b/Mastodon/Scene/Compose/ComposeViewController.swift @@ -809,7 +809,11 @@ extension ComposeViewController: ComposeToolbarViewDelegate { } func composeToolbarView(_ composeToolbarView: ComposeToolbarView, pollButtonDidPressed sender: UIButton) { + // toggle poll composing state viewModel.isPollComposing.value.toggle() + + // cancel custom picker input + viewModel.isCustomEmojiComposing.value = false // setup initial poll option if needs if viewModel.isPollComposing.value, viewModel.pollOptionAttributes.value.isEmpty { @@ -831,6 +835,9 @@ extension ComposeViewController: ComposeToolbarViewDelegate { } func composeToolbarView(_ composeToolbarView: ComposeToolbarView, contentWarningButtonDidPressed sender: UIButton) { + // cancel custom picker input + viewModel.isCustomEmojiComposing.value = false + // restore first responder for text editor when content warning dismiss if viewModel.isContentWarningComposing.value { if contentWarningEditorTextView()?.isFirstResponder == true {