Skip to content

Commit

Permalink
Merge pull request #1483 from colouring-cities/boolean-entry-fixes
Browse files Browse the repository at this point in the history
Boolean entry fixes
  • Loading branch information
mdsimpson42 authored Feb 4, 2025
2 parents 036cffa + f0c10f3 commit cb213bc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* Hide the browser's default radio button */
.boolean input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';

import './logical-data-entry.css';

import { BaseDataEntryProps } from '../data-entry';
import { DataTitleCopyable } from '../data-title';

Expand Down Expand Up @@ -33,12 +35,14 @@ const ToggleButton: React.FC<ToggleButtonProps> = ({
style: { cursor: 'default'}
}}
>
<input type="radio" name="options" value={value + ''}
autoComplete="off"
checked={checked}
onChange={onChange}
disabled={disabled}
/>
<div className="boolean">
<input type="radio" name="options" value={value + ''}
autoComplete="off"
checked={checked}
onChange={onChange}
disabled={disabled}
/>
</div>
{children}
</label>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import withCopyEdit from '../data-container';

import { CategoryViewProps } from './category-view-props';
import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry';
import { LogicalDataEntry, LogicalDataEntryYesOnly } from '../data-components/logical-data-entry/logical-data-entry';
import { LogicalDataEntry } from '../data-components/logical-data-entry/logical-data-entry';

/**
* Construction & Design view/edit section
Expand Down Expand Up @@ -1237,7 +1237,7 @@ const ConstructionDesignView: React.FunctionComponent<CategoryViewProps> = (prop
</DataEntryGroup>
</DataEntryGroup>
<DataEntryGroup name="Awards" collapsed={subcat==null || subcat!="12"}>
<LogicalDataEntryYesOnly
<LogicalDataEntry
slug='designer_awards'
title={dataFields.designer_awards.title}
tooltip={dataFields.designer_awards.tooltip}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { commonSourceTypes, dataFields } from '../../config/data-fields-config';
import SelectDataEntry from '../data-components/select-data-entry';
import NumericDataEntry from '../data-components/numeric-data-entry';
import Verification from '../data-components/verification';
import { LogicalDataEntry, LogicalDataEntryYesOnly } from '../data-components/logical-data-entry/logical-data-entry';
import { LogicalDataEntry } from '../data-components/logical-data-entry/logical-data-entry';
import { DataEntryGroup } from '../data-components/data-entry-group';
import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry';
import withCopyEdit from '../data-container';
Expand Down

0 comments on commit cb213bc

Please sign in to comment.