carbon-app/carbon

Code is horizontally clipped when viewed in Medium as embedded content

Open

#1,259 opened on 2021年9月26日

GitHub で見る
 (2 comments) (0 reactions) (0 assignees)JavaScript (1,974 forks)batch import
bughelp wanted

Repository metrics

Stars
 (36,024 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

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

コントリビューターガイド