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

RichTextViewer .clear background color? #208

Open
gerzonc opened this issue Oct 17, 2024 · 5 comments
Open

RichTextViewer .clear background color? #208

gerzonc opened this issue Oct 17, 2024 · 5 comments
Labels
adjustment Changes to existing functionality

Comments

@gerzonc
Copy link

gerzonc commented Oct 17, 2024

Hi there!

I'm trying to achieve the same as #173 but for the RichTextViewer. Since it only takes one parameter, not sure how can we achieve this? I tried with the .richTextEditorStyle() and background(.clear) and they didn't work.

Here is my sample code

 RichTextViewer(thoughts)
    .frame(minHeight: 250)
    .frame(maxWidth: .infinity)
    .scrollDisabled(true)
    .richTextEditorStyle(RichTextEditorStyle(backgroundColor: .clear))
    .background(.clear)
    .cornerRadius(8)
    .id(thoughts.string)
@danielsaidi
Copy link
Owner

If you want a clear editor, can you use the view configuration parameter when setting up the view?

@gerzonc
Copy link
Author

gerzonc commented Oct 17, 2024

If you want a clear editor, can you use the view configuration parameter when setting up the view?

Not using the editor in this case, just the viewer (this one only receives the NSAttributeString it seems). Or is the RichTextViewer meant to be deprecated? Using a RichTextEditor with editable disabled does the trick here?

@danielsaidi
Copy link
Owner

The RichTextViewer is basically just a disabled RichTextEditor so I'd say that it should expose the same configuration method as the editor.

Until then, please try with a disabled editor and let me know if that works. I could then add the configuration to the viewer.

@danielsaidi danielsaidi added the adjustment Changes to existing functionality label Oct 21, 2024
@gerzonc
Copy link
Author

gerzonc commented Oct 21, 2024

The RichTextViewer is basically just a disabled RichTextEditor so I'd say that it should expose the same configuration method as the editor.

Until then, please try with a disabled editor and let me know if that works. I could then add the configuration to the viewer.

Oh yeah, it works flawlessly :)
image

@danielsaidi
Copy link
Owner

That's perfect - I'll make the change then! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adjustment Changes to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants