Environment: Xcode 10.2, macOS Mojave Version 10.14.5
I create an NSTextField with an attributed string like below:
let name = "Someone"
let link = "http://example.com/people/\(name)"
let attributedString = NSMutableAttributedString(string: name)
// link without underline
attributedString.addAttributes([.link : link, .underlineStyle : 0], range: NSRange(location: 0, length: name.count))
// bind UI
let label = NSTextField(frame: CGRect(x: 10, y: 10, width: 100, height: 30))
label.allowsEditingTextAttributes = true
label.isSelectable = true
label.attributedStringValue = attributedString
When the UI shows successfully, I click the link, the text area will be layout again and text shrink. Do I have missed something?