gonzalezreal / swift-markdown-ui

Display and customize Markdown text in SwiftUI
MIT License
2.25k stars 268 forks source link

Markdown text disappearing after presenting a sheet #78

Closed helloniklas closed 2 years ago

helloniklas commented 2 years ago

So I have this app with a rather elaborate view hierarchy. For some reason when I present a sheet on top of the Markdown text then dismiss it the markdown text disappears but everything is else is still there.

I've tried to present a sheet in a vanilla standalone project and it works fine there. So not sure exactly what triggers this behaviour in my project. But all other UI elements works fine, it's only the markdown view that disappears.

Any idea why this could happen? Something with the states of the view not re-rendering somehow?

mokkun commented 2 years ago

Have a similar issue, but when displaying a context menu for a list item that has markdown.

heltena commented 2 years ago

I had a similar issue. In my case, everything works on iOS 14, but Markdown disappears o iOS 15. I could isolate the error in a simple example:

https://github.com/heltena/MarkdownTest

To reproduce the error:

Best!

helloniklas commented 2 years ago

I'm seeing the issue in both iOS14.5 and iOS15...

heltena commented 2 years ago

Sorry, maybe I should have opened another ticket instead of using yours. It looks close similar. Could you try my pull request in your code?

helloniklas commented 2 years ago

Yeah it’s probably related. Will try it when I’ll get back to a computer.

gonzalezreal commented 2 years ago

I will have a look at this as soon as I can. Thanks for reporting it.

gonzalezreal commented 2 years ago

Hi all,

I fixed this issue in the release-1.0 branch. Notice this branch is still a work in progress and contains other breaking changes I am making in preparation for the upcoming 1.0 release. I will close this issue once I release MarkdownUI 1.0.

@heltena, thanks for providing a test project to reproduce the issue. That helped a lot.

helloniklas commented 2 years ago

I can confirm this solves my issue as well. Many thanks.