diff --git a/Sources/LilithForms/SearchInput.swift b/Sources/LilithForms/SearchInput.swift index c56bbb4..18bd2c3 100755 --- a/Sources/LilithForms/SearchInput.swift +++ b/Sources/LilithForms/SearchInput.swift @@ -4,6 +4,9 @@ // Search input field with magnifying glass icon and clear button import SwiftUI +#if canImport(UIKit) +import UIKit +#endif import LilithDesignTokens /// Search input field @@ -74,8 +77,10 @@ public struct SearchInput: View { TextField(placeholder, text: $text) .font(AppTypography.body()) .foregroundColor(AppColors.textPrimary) - .autocapitalization(.none) - .disableAutocorrection(true) + #if os(iOS) || os(tvOS) || os(watchOS) || os(visionOS) + .textInputAutocapitalization(.never) + #endif + .autocorrectionDisabled() .disabled(isDisabled) .focused($isFocused) .onChange(of: text) { _, newValue in @@ -151,9 +156,10 @@ public struct SearchInput: View { private func clearSearch() { text = "" - // Light haptic feedback + #if canImport(UIKit) let generator = UIImpactFeedbackGenerator(style: .light) generator.impactOccurred() + #endif onSearch?("") } diff --git a/Sources/LilithForms/TextArea.swift b/Sources/LilithForms/TextArea.swift index f6d4fc2..27c1200 100755 --- a/Sources/LilithForms/TextArea.swift +++ b/Sources/LilithForms/TextArea.swift @@ -194,6 +194,7 @@ public struct TextArea: View { // MARK: - Preview Provider #if DEBUG +@available(macOS 14.0, iOS 17.0, *) struct TextArea_Previews: PreviewProvider { static var previews: some View { ScrollView {