Skip to content

Commit

Permalink
Fix confirmation button asset page
Browse files Browse the repository at this point in the history
  • Loading branch information
mrica-equinor committed Nov 10, 2023
1 parent bbbf69c commit cadcae7
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,14 @@ function InstallationPicker() {
placeholder={TranslateText('Select installation')}
onOptionsChange={({ selectedItems }) => {
const selectedName = selectedItems[0]
setSelectedInstallation(selectedName)
validateInstallation(selectedName)
? setSelectedInstallation(selectedName)
: setSelectedInstallation('')
}}
onInput={(e: React.ChangeEvent<HTMLInputElement>) => {
setSelectedInstallation(e.target.value ?? '')
validateInstallation(e.target.value)
? setSelectedInstallation(e.target.value)
: setSelectedInstallation('')
}}
autoWidth={true}
onFocus={(e) => {
Expand All @@ -137,7 +141,7 @@ function InstallationPicker() {
</BlockLevelContainer>
<Button
onClick={() => switchInstallation(selectedInstallation)}
disabled={!validateInstallation(selectedInstallation)}
disabled={!selectedInstallation}
href={`${config.FRONTEND_BASE_ROUTE}/FrontPage`}
>
{TranslateText('Confirm installation')}
Expand Down

0 comments on commit cadcae7

Please sign in to comment.