Back to API Reference
Class

KeyboardAvoidanceBehavior

sealed

Keeps the field (or any assigned target) visible above the software keyboard by translating it upward, animated in lockstep with the system keyboard — the classic "lift the form so the keyboard doesn't cover it" reaction.

Remarks

Translation moves anchoredPosition.y, so the target must not be driven by a layout group on that axis — point target at the popup / panel root, not a layout child (for layout-driven forms a resize or scroll reaction fits better). On platforms without frame-synced keyboard animation (iOS, Android <30, WebGL) the motion is driven client-side from the event's timing metadata, or fallbackDuration / fallbackEasing when the platform provides none.
public RectTransform Target{ get; set }

Rect translated to remain visible; null resolves the field's clipping parent.

public float KeyboardPadding{ get; set }

Physical gap retained above the keyboard, measured in density-independent pixels.

public bool OnlyWhenOverlapping{ get; set }

Whether an already visible target remains at its authored position.

public float FallbackDuration{ get; set }

Client-side animation duration used when the platform supplies no timing.

public KeyboardEasing FallbackEasing{ get; set }

Client-side easing used when the platform supplies no animation curve.

protected bool IsAnimating{ get }
protected override void OnFocusGained()
protected override void OnFocusLost()
protected override void OnKeyboardWillShow()
protected override void OnKeyboardWillChangeFrame()
protected override void OnKeyboardWillHide()
protected override void OnKeyboardAnimationProgress()
protected override void OnKeyboardDidShow()
protected override void OnKeyboardDidHide()
protected override void OnKeyboardUpdate()