Skip to content

Commit

Permalink
Always presents large tool picker for primary buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbs committed Jun 27, 2022
1 parent 17d8495 commit a97268a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/KeyboardToolbar/Views/KeyboardToolButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,17 @@ private extension KeyboardToolButton {
toolPickerBackgroundView.fillColor = toolPickerBackgroundColor
UIDevice.current.playInputClick()
cancelToolPickerTimer()
guard !item.allTools.isEmpty else {
let shouldPresentPicker = item.style == .primary || !item.allTools.isEmpty
guard shouldPresentPicker else {
return
}
setContentHidden(true)
feedbackGenerator.prepare()
if showToolPickerDelay > 0 {
presentToolPicker(with: [item.representativeTool], atSize: .large)
schedulePresentingAllTools()
if !item.allTools.isEmpty {
schedulePresentingAllTools()
}
} else {
presentToolPicker(with: item.allTools, atSize: .large)
}
Expand Down

0 comments on commit a97268a

Please sign in to comment.