Skip to content

Cannot hide font picker #243

@jonasbarsten

Description

@jonasbarsten

Hi!

Seems like the richTextFormatSheetConfigs fontPicker: false does not do what it is supposed to.

I edited a fresh clone of the repos DemoEditorScreen.swift to this:

import RichTextKit
import SwiftUI

struct DemoEditorScreen: View {

    @Binding var document: DemoDocument
    @StateObject var context = RichTextContext()

    var body: some View {
        VStack(spacing: 0) {
            RichTextEditor(
                text: $document.text,
                context: context
            )
            RichTextKeyboardToolbar(
                context: context,
                leadingButtons: { $0 },
                trailingButtons: { $0 },
                formatSheet: { $0 }
            )
        }
        .richTextFontPickerConfig(.init(fonts: []))
        .richTextFormatSheetConfig(.init(
            alignments: [],
            colorPickers: [],
            colorPickersDisclosed: [],
            fontPicker: false,
            fontSizePicker: false,
            indentButtons: false,
            styles: .all,
            superscriptButtons: false
        ))
        
    }
}

It renders a preview like this:

Image

I guess it is supposed to hide the fontPicker part of the sheet.
I have kinda not read the whole documentation tho, but yeah, looked like a bug:)

All the best

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions