Skip to content

Commit

Permalink
Fix tags deleting of hidden side form (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlant committed Sep 26, 2024
1 parent a78ec7e commit 8bc931a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/parking/controls/editor/EditorForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,18 @@ export function LaneEditForm(props: {
</div>
</div>
<div id="tags-block">
{bothBlockShown ? <SideGroup osm={props.osm} side='both' onChange={handleInputChange} /> : null}
{!bothBlockShown ? <SideGroup osm={props.osm} side='right' onChange={handleInputChange} /> : null}
{!bothBlockShown ? <SideGroup osm={props.osm} side='left' onChange={handleInputChange} /> : null}
<SideGroup osm={props.osm}
side='both'
shown={bothBlockShown}
onChange={handleInputChange} />
<SideGroup osm={props.osm}
side='right'
shown={!bothBlockShown}
onChange={handleInputChange} />
<SideGroup osm={props.osm}
side='left'
shown={!bothBlockShown}
onChange={handleInputChange} />
<AllTagsBlock tags={props.osm.tags} />
</div>

Expand Down
4 changes: 3 additions & 1 deletion src/parking/controls/editor/SideGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ import { parkingLaneTags } from './lane-tags'
export function SideGroup(props: {
osm: OsmWay
side: 'both' | 'left' | 'right'
shown: boolean
onChange: (e: React.SyntheticEvent, way: OsmWay) => void
}) {
return (
<div id={props.side}
className={`tags-block tags-block_${props.side}`}>
className={`tags-block tags-block_${props.side}`}
style={{ display: props.shown ? undefined : 'none' }} >
<table>
<TagInputs
osm={props.osm}
Expand Down

0 comments on commit 8bc931a

Please sign in to comment.