Skip to content

Commit

Permalink
Update BackgroundGeometryReader
Browse files Browse the repository at this point in the history
  • Loading branch information
ns-vasilev committed Oct 17, 2023
1 parent 4f42959 commit 73795b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import SwiftUI

/// <#Description#>
// A view that reads the geometry of its parent view and updates a binding variable with its size.
struct BackgroundGeometryReader: View {
// MARK: Properties

Expand All @@ -14,15 +14,11 @@ struct BackgroundGeometryReader: View {
// MARK: View

var body: some View {
GeometryReader(content: placeholderHeight(_:))
}

// MARK: Private

private func placeholderHeight(_ geometry: GeometryProxy) -> some View {
DispatchQueue.main.async {
size = geometry.size
GeometryReader { geometry in
Color.clear
.onAppear {
size = geometry.size
}
}
return Color.clear
}
}
2 changes: 2 additions & 0 deletions Sources/FloatingTextField/Classes/UI/FloatingTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public struct FloatingTextField: View {
.multilineTextAlignment(.leading)
.font(configuration.font)
.focused($isFocused)
.disabled(configuration.disabled)
}

private var textField: some View {
Expand All @@ -132,6 +133,7 @@ public struct FloatingTextField: View {
.multilineTextAlignment(.leading)
.font(configuration.font)
.focused($isFocused)
.disabled(configuration.disabled)
}

private var contentView: some View {
Expand Down

0 comments on commit 73795b2

Please sign in to comment.