Skip to main content

close

close

Closes the current form and returns a result to the caller.

Parameters

  • result (any): The result to return to whoever opened the form (may be null)

Returns: None (void)

Description

$form.close calls Navigator.pop() to close the current form. Use it for forms sitting on the Navigator stack — dialogs, sheets, drawers, full-screen dialogs.

warning

It does not work on background forms. A form opened with $app.openBackgroundForm() is Overlay-based and isn't part of the Navigator stack. To close a background form, use $app.closeBackgroundForm(path, result).

Example

// 단순 닫기
$form.close(null);

// 결과값 반환
$form.close({ confirmed: true, selectedId: "item_001" });

// 조건부 닫기
if (isValid) {
$form.close({ success: true });
} else {
$log.i("유효하지 않음 — 닫기 취소");
}

Related

  • $form.closeDialog(result) — closes a dialog or popover
  • $form.closePopover(result) — closes a popover
  • $app.closeBackgroundForm(formPath, result) — closes a background form