fix: fix the bug where the clear button on LazyTextField doesn't work

This commit is contained in:
Kenta Kubo 2025-09-02 03:48:53 +09:00
parent 4bbda1c4cc
commit f2db5aa19b

View file

@ -28,6 +28,7 @@ extension LazyTextField: View {
if self.isFocused && !self.localText.isEmpty { if self.isFocused && !self.localText.isEmpty {
Button("Clear", systemImage: "xmark.circle.fill") { Button("Clear", systemImage: "xmark.circle.fill") {
self.text.removeAll() self.text.removeAll()
self.localText.removeAll()
} }
.foregroundStyle(Color.primary) .foregroundStyle(Color.primary)
.opacity(0.2) .opacity(0.2)