From 3b9ee170b9660297ffbf3a2cfb25f9427c5ff374 Mon Sep 17 00:00:00 2001 From: Ryan Berger Date: Mon, 22 Jan 2024 14:38:41 -0500 Subject: [PATCH] STCOR-794: Disable Continue button when no tenant selected (#1400) --- src/components/PreLoginLanding/PreLoginLanding.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/PreLoginLanding/PreLoginLanding.js b/src/components/PreLoginLanding/PreLoginLanding.js index 7c17c663e..acc11e642 100644 --- a/src/components/PreLoginLanding/PreLoginLanding.js +++ b/src/components/PreLoginLanding/PreLoginLanding.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useRef } from 'react'; import { Button, Select, Col, Row } from '@folio/stripes-components'; import { useIntl } from 'react-intl'; import PropTypes from 'prop-types'; @@ -21,8 +21,11 @@ function PreLoginLanding({ onSelectTenant }) { return ''; }; + const submitButtonRef = useRef({ disabled: true }); + const handleChangeTenant = (e) => { const tenantName = e.target.value; + submitButtonRef.current.disabled = !tenantName; if (tenantName === '') { onSelectTenant('', ''); return; @@ -50,7 +53,8 @@ function PreLoginLanding({ onSelectTenant }) { />