Skip to content

Commit c4aaad7

Browse files
committed
Fix accessibilityElement frame to account for layoutMargins.top (bug introduced with intrinsicContentSize fix)
1 parent 687a33a commit c4aaad7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ActiveLabel/ActiveLabel.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ public protocol ActiveLabelDelegate: class {
314314
private func accessibilityFrameForTextRange(range: NSRange) -> CGRect {
315315
var glyphRange = NSRange()
316316
layoutManager.characterRangeForGlyphRange(range, actualGlyphRange: &glyphRange)
317-
let boundingRect = layoutManager.boundingRectForGlyphRange(glyphRange, inTextContainer: textContainer)
317+
var boundingRect = layoutManager.boundingRectForGlyphRange(glyphRange, inTextContainer: textContainer)
318+
boundingRect.origin.y += layoutMargins.top
318319
return UIAccessibilityConvertFrameToScreenCoordinates(boundingRect, self)
319320
}
320321

0 commit comments

Comments
 (0)