carbon-app/carbon

Code is horizontally clipped when viewed in Medium as embedded content

Open

#1,259 创建于 2021年9月26日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)JavaScript (36,024 star) (1,974 fork)batch import
bughelp wanted

描述

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

贡献者指南