Composer Launch Delay
Nucleic-Session: EDE6C55C-8E3E-41BF-9DA0-A148C554C984 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -237,12 +237,11 @@ struct NewChatAffordance: ViewModifier {
|
|||||||
.onChange(of: isPresented) { _, open in
|
.onChange(of: isPresented) { _, open in
|
||||||
if open {
|
if open {
|
||||||
draft = ""
|
draft = ""
|
||||||
// Focus once the bar has sprung into place, so the keyboard rises against a
|
// Focus in the same turn the bar is presented so the keyboard rises immediately,
|
||||||
// settled layout — otherwise its avoidance inset is computed mid-animation and
|
// riding up together with the bar (both animate from the bottom edge at t=0)
|
||||||
// the keyboard lands overlapping the bar until the next re-layout.
|
// instead of waiting for the spring to settle first — no perceptible delay
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.35) {
|
// between the composer appearing and the keyboard opening.
|
||||||
if isPresented { draftFocused = true }
|
draftFocused = true
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
draftFocused = false
|
draftFocused = false
|
||||||
draft = ""
|
draft = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user