@momo-kits/native-kits 0.117.1-beta.12 → 0.117.1-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,6 +38,9 @@ public struct PopupDisplay: View {
38
38
 
39
39
  // MARK: Public
40
40
 
41
+ @State private var textHeight: CGFloat = .zero
42
+ @State private var isScrollable = false
43
+
41
44
  public var body: some View {
42
45
  var shouldUseColumn: Bool {
43
46
  buttonDirection == .column || (buttonDirection == .auto && (closeButtonTitle.count > 12 || actionButtonTitle.count > 12))
@@ -80,12 +83,37 @@ public struct PopupDisplay: View {
80
83
  .lineLimit(2)
81
84
  .accessibility(identifier: "title_popup_permission")
82
85
 
83
- Text(description)
84
- .foregroundColor(.black)
85
- .font(.paragraph)
86
- .opacity(0.6)
87
- .multilineTextAlignment(.leading)
88
- .padding(.bottom, 8)
86
+ Group {
87
+ if isScrollable {
88
+ ScrollView(showsIndicators: false) {
89
+ Text(description)
90
+ .font(.paragraph)
91
+ .foregroundColor(.black)
92
+ .opacity(0.6)
93
+ .multilineTextAlignment(.leading)
94
+ .background(GeometryReader { geo in
95
+ Color.clear
96
+ .onAppear {
97
+ textHeight = geo.size.height
98
+ }
99
+ })
100
+ }
101
+ .frame(height: 60)
102
+ } else {
103
+ Text(description)
104
+ .font(.paragraph)
105
+ .foregroundColor(.black)
106
+ .opacity(0.6)
107
+ .multilineTextAlignment(.leading)
108
+ .background(GeometryReader { geo in
109
+ Color.clear
110
+ .onAppear {
111
+ textHeight = geo.size.height
112
+ isScrollable = textHeight > 60 // adjust threshold to ~3 lines
113
+ }
114
+ })
115
+ }
116
+ }.padding(.bottom, 8)
89
117
 
90
118
  if(!errorCode.isEmpty) {
91
119
  Text(errorCode)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.117.1-beta.12",
3
+ "version": "0.117.1-beta.13",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},