carbon-app/carbon

Code is horizontally clipped when viewed in Medium as embedded content

Open

#1259 aperta il 26 set 2021

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)JavaScript (1974 fork)batch import
bughelp wanted

Metriche repository

Star
 (36.024 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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),
        ])
    }
}

Guida contributor