Skip to content

Commit caa4748

Browse files
committed
[#250] isToggleOff TextField Color fix
1 parent 1b09bee commit caa4748

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: YDS-Storybook/SwiftUI/Storybook/OptionView/OptionalStringOptionView.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ struct OptionalStringOptionView: View {
2727
@Binding private var text: String?
2828

2929
private let description: String?
30-
30+
31+
@State private var isToggleOn = true
3132
@State private var placeholder: String
3233

3334
init(description: String?, text: Binding<String?>) {
@@ -54,6 +55,7 @@ struct OptionalStringOptionView: View {
5455
},
5556
set: { isOn in
5657
isOn ? (text = placeholder) : (text = nil)
58+
self.isToggleOn = isOn
5759
}
5860
))
5961
.labelsHidden()
@@ -72,6 +74,7 @@ struct OptionalStringOptionView: View {
7274
.font(YDSFont.body1)
7375
.tint(YDSColor.textPointed)
7476
.padding(Dimension.Padding.button)
77+
.foregroundColor(isToggleOn ? YDSColor.bgNormalDark : YDSColor.bgDimDark)
7578
.background(
7679
RoundedRectangle(cornerRadius: Dimension.Rectangle.cornerRadius)
7780
.fill(YDSColor.inputFieldElevated)

0 commit comments

Comments
 (0)