Skip to content

Latest commit

 

History

History
71 lines (54 loc) · 1.02 KB

keyboard.md

File metadata and controls

71 lines (54 loc) · 1.02 KB
id keyboard
title Keyboard
officialDoc https://reactnative.dev/docs/keyboard

Types

type keyboardMetrics = {
  screenX: float,
  screenY: float,
  width: float,
  height: float,
}

type eventType = [
  | #keyboardWillShow
  | #keyboardDidShow
  | #keyboardWillHide
  | #keyboardDidHide
  | #keyboardWillChangeFrame
  | #keyboardDidChangeFrame
]

type keyboardEvent = {
  duration: float,
  easing: LayoutAnimation.animationType,
  endCoordinates: keyboardMetrics,
  startCoordinates: keyboardMetrics,
  isEventFromThisApp: bool,
}

Methods

addListener

addListener: (eventType, keyboardEvent => unit) => EventSubscription.t

removeAllListeners

removeAllListeners: eventType => unit

dismiss

dismiss: unit => unit

isVisible

isVisible: unit => bool

metrics

metrics: unit => option<keyboardMetrics>

scheduleLayoutAnimation

scheduleLayoutAnimation: keyboardEvent => unit