We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug On tvOS, Markdown view is badly positionned in a scrollview. A part of the view is out of screen.
Checklist
main
Steps to reproduce
Copy past the code in a basic project with swift-markdown-ui as dependency. Enable tvOS Support. Try the 3 options like the video.
Expected behavior I'm expecting to be able to scroll on a scrollview when i'm putting a markdown element.
Screenshots https://github.com/user-attachments/assets/cddec0d6-0237-4bd0-9873-85bfee9cd44d
Version information
Additional context
import SwiftUI import MarkdownUI struct ContentView: View { var body: some View { // Badly positionned on top // Markdown(Constants.basicMarkdown) // Goodly positionned on top but don't scroll // ScrollView { // Markdown(Constants.basicMarkdown) // } // Badly positionned on top and bot but scroll good CustomScrollView { Markdown(Constants.basicMarkdown) } } } #Preview { ContentView() } struct Constants { static let basicMarkdown = """ # Analyse Complémentaire 1 Les efforts de vente ont permis d'atteindre les objectifs dans certaines régions malgré quelques difficultés dans d'autres. Un suivi est recommandé dans les régions en baisse pour maintenir la dynamique globale. # Analyse Complémentaire 2 # Analyse Complémentaire 3 # Analyse Complémentaire 4 # Analyse Complémentaire 5 # Analyse Complémentaire 6 # Analyse Complémentaire 7 # Analyse Complémentaire 8 # Analyse Complémentaire 9 # Analyse Complémentaire 10 # Analyse Complémentaire 11 # Analyse Complémentaire 12 """ } struct CustomScrollView<Content: View>: UIViewRepresentable { let content: Content init(@ViewBuilder content: () -> Content) { self.content = content() } func makeUIView(context: Context) -> UIScrollView { let scrollView = UIScrollView() scrollView.panGestureRecognizer.allowedTouchTypes = [NSNumber(integerLiteral: UITouch.TouchType.indirect.rawValue)] let hostingController = UIHostingController(rootView: content) hostingController.view.translatesAutoresizingMaskIntoConstraints = false scrollView.addSubview(hostingController.view) NSLayoutConstraint.activate([ hostingController.view.topAnchor.constraint(equalTo: scrollView.topAnchor), hostingController.view.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor), hostingController.view.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor), hostingController.view.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor), hostingController.view.widthAnchor.constraint(equalTo: scrollView.widthAnchor) ]) return scrollView } func updateUIView(_ uiView: UIScrollView, context: Context) { } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
On tvOS, Markdown view is badly positionned in a scrollview. A part of the view is out of screen.
Checklist
main
branch of this package.Steps to reproduce
Copy past the code in a basic project with swift-markdown-ui as dependency.
Enable tvOS Support.
Try the 3 options like the video.
Expected behavior
I'm expecting to be able to scroll on a scrollview when i'm putting a markdown element.
Screenshots
https://github.com/user-attachments/assets/cddec0d6-0237-4bd0-9873-85bfee9cd44d
Version information
Additional context
The text was updated successfully, but these errors were encountered: