onFocusChange method

void onFocusChange(
  1. bool focus
)

Implementation

void onFocusChange(bool focus) {
  if (hasFocus != focus) {
    hasFocus = focus;
    if (focusEventEnable || blurEventEnable) {
      var paramsMap = VoltronMap();
      paramsMap.push("text", text);
      if (hasFocus) {
        context.renderBridgeManager.sendComponentEvent(
          rootId,
          id,
          TextInputController.kEventOnFocus,
          paramsMap,
        );
      } else {
        context.renderBridgeManager.sendComponentEvent(
          rootId,
          id,
          TextInputController.kEventOnBlur,
          paramsMap,
        );
      }
    }
  }
}