focusField method

bool focusField(
  1. String? fieldName
)
inherited

Implementation

bool focusField(String? fieldName) {
  if (fieldName == null) return false;

  var component = getFieldComponent(fieldName);

  if (component is UIElement) {
    component.focus();
    return true;
  } else if (component is UIComponent) {
    var input = findInContentChildDeep((e) => e.isTextInput);
    if (input != null) {
      input.focus();
      return true;
    }

    component.content?.focus();
    return true;
  }

  return false;
}