How to use @zendeskgarden/container-focusjail - 1 common examples

To help you get started, we’ve selected a few @zendeskgarden/container-focusjail examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zendeskgarden / react-containers / packages / modal / src / useModal.ts View on Github external
id,
      ...other
    };
  };

  const getCloseProps = ({ onClick, ...other } = {} as any) => {
    return {
      'aria-label': 'Close modal',
      onClick: composeEventHandlers(onClick, (event: MouseEvent) => {
        closeModal(event);
      }),
      ...other
    };
  };

  const { getContainerProps } = useFocusJail({ containerRef: modalRef, focusOnMount, environment });

  return {
    getBackdropProps,
    getModalProps: props => getContainerProps(getModalProps(props)),
    getTitleProps,
    getContentProps,
    getCloseProps,
    closeModal
  };
}

@zendeskgarden/container-focusjail

Containers relating to focusjail in the Garden Design System

Apache-2.0
Latest version published 3 months ago

Package Health Score

77 / 100
Full package analysis

Popular @zendeskgarden/container-focusjail functions