carbon-app/carbon

Code is horizontally clipped when viewed in Medium as embedded content

Offen

#1.259 geöffnet am 26.09.2021

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.974 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (36.024 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Describe the bug Code is horizontally clipped when viewed in Medium as embedded content

To Reproduce

  • Use https://carbon.now.sh/ to generat a code snippet
  • Paste embed URL into a Medium article + hit enter
  • You should be able to see clipped code with no way of horizontally scrolling

Expected behavior I would expect to be able to scroll left and right to see the rest of the code

Screenshots Info (please complete the following information):

  • iOS 14.7.1 iPhone 12 mini
  • Viewing on Medium's iPhone app
import UIKit

public extension UIScrollView {
    convenience init(stackView: UIStackView) {
        self.init(frame: .zero)

        stackView.translatesAutoresizingMaskIntoConstraints = false
        addSubview(stackView)

        NSLayoutConstraint.activate([
            stackView.topAnchor.constraint(equalTo: contentLayoutGuide.topAnchor),
            stackView.bottomAnchor.constraint(equalTo: contentLayoutGuide.bottomAnchor),
            stackView.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor),
            stackView.trailingAnchor.constraint(equalTo: safeAreaLayoutGuide.trailingAnchor),
            contentLayoutGuide.widthAnchor.constraint(equalTo: widthAnchor),
        ])
    }
}

Contributor Guide