From b04385ceaea183ba2e262d2b72c9af019eabcf6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20F=C3=B6rster?= Date: Tue, 5 Dec 2023 00:36:12 +0100 Subject: [PATCH] macOS: disable hit testing when not expanded fixes overspilling of text when clicking on collapsed descriptions --- Shared/Player/Video Details/VideoDescription.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Shared/Player/Video Details/VideoDescription.swift b/Shared/Player/Video Details/VideoDescription.swift index 7f25cc75..9ba9b29a 100644 --- a/Shared/Player/Video Details/VideoDescription.swift +++ b/Shared/Player/Video Details/VideoDescription.swift @@ -56,27 +56,24 @@ struct VideoDescription: View { } } - var shouldExpand: Bool { - expand - } - @ViewBuilder var textDescription: some View { #if canImport(AppKit) Group { if #available(macOS 12, *) { DescriptionWithLinks(description: description, detailsSize: detailsSize) .frame(maxWidth: .infinity, alignment: .leading) - .lineLimit(shouldExpand ? 500 : collapsedLinesDescription) + .lineLimit(expand ? 500 : collapsedLinesDescription) .textSelection(.enabled) } else { Text(description) .frame(maxWidth: .infinity, alignment: .leading) - .lineLimit(shouldExpand ? 500 : collapsedLinesDescription) + .lineLimit(expand ? 500 : collapsedLinesDescription) } } .multilineTextAlignment(.leading) .font(.system(size: 14)) .lineSpacing(3) + .allowsHitTesting(expand) #endif }