FB13466450: SwiftUI PasteButton should accept a title
sindresorhus opened this issue · comments
- Date: 2023-12-13
- Resolution: Open
- Area: SwiftUI
- OS: macOS 14.2
- Type: Suggestion
Description
There are many cases where you don’t want the title “Paste”. For example, if there are multiple different things that can be pasted or if you need to add more context to the paste. In my case, I need the title to be “Paste Tasks”. If there is a UX or security reason why it’s left out, you could support a title, but require it to contain the word “Paste”.
I also tried using LabeledContent
, but it does not work in Menu
, where it shows up as two menu items:
LabeledContent("Paste Tasks") {
PasteButton(payloadType: String.self) {
pasteTasks($0)
}
.labelsHidden()
}