Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard toolbar modifier doesn't work #8

Closed
danielsaidi opened this issue Jul 15, 2022 · 3 comments
Closed

Keyboard toolbar modifier doesn't work #8

danielsaidi opened this issue Jul 15, 2022 · 3 comments
Labels
feature New feature or request
Milestone

Comments

@danielsaidi
Copy link
Owner

Since RichTextKit wraps UIKit and AppKit, the SwiftUI toolbar view modifier with keyboard placement doesn't work.

In other words, this will not work:

RichTextEditor(text: $text, context: textEditorContext)
    .frame(minHeight: 200)
    .toolbar {
        ToolbarItem(placement: .keyboard) {
            Button {
                richTextContext.isBold.toggle()
            } label: {
                Image(systemName: "bold")
            }
        }
    }

In my own app, I developed a custom toolbar that was pinned above the keyboard. The library should offer this custom toolbar as a feature.

@danielsaidi danielsaidi added adjustment Changes to existing functionality feature New feature or request and removed adjustment Changes to existing functionality labels Jul 15, 2022
@jdelano
Copy link
Contributor

jdelano commented Jul 16, 2022

@danielsaidi Thanks for considering this. Here's one approach that I used that worked well with RichTextKit's editor.

@danielsaidi
Copy link
Owner Author

Yeah, this is absolutely something the library should simplify :)

Thanks for the link - I will check it out!

@danielsaidi
Copy link
Owner Author

danielsaidi commented Dec 14, 2022

I have added a new keyboard toolbar to the library, which I think removes the need for using a SwiftUI toolbar item with .keyboard placement.

The new toolbar will be available in 0.3.

@danielsaidi danielsaidi added this to the 0.3 milestone Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants