Merge pull request #125 from kkebo/fix-clear-button

fix: fix the bug where the clear button on `LazyTextField` doesn't work
This commit is contained in:
Kenta Kubo 2025-09-02 22:31:36 +09:00 committed by GitHub
commit febbf73029
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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