Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ui-component-library / src / inputs / TextBox / handlers / handleBlur.ts
Size: Mime:
import { isFunction } from 'exotic'
import { TextBoxProps, TextBoxState, TextBoxComponent } from '../typings'

/**
 * @extends TextBoxComponent @bound
 */
export function handleBlur(event: Event, props: TextBoxProps, state: TextBoxState) {
  const { onBlur, onFormValidation } = props

  // @todo @fixme should not need to pass in
  state.updateFocused(event, this)

  if (isFunction(onBlur)) {
    onBlur(state.value)
  }
  if (isFunction(onFormValidation)) {
    onFormValidation(state, props)
  }
}