Skip to content

Commit

Permalink
Merge pull request #521 from bcgov/5.6-prod-fixes
Browse files Browse the repository at this point in the history
fix city dropdown issue
  • Loading branch information
mgtennant authored Feb 19, 2025
2 parents 8f52d14 + 9128e0e commit d60156a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/client/src/features/lookups/Cities.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Form, Alert, Spinner } from "react-bootstrap";
import { REQUEST_STATUS } from "../../utilities/constants";

const Cities = React.forwardRef((props, ref) => {
const { cities, isInvalid, onChange, defaultValue } = props;
const { cities, isInvalid, onChange, value } = props;

let control = (
<div>
Expand All @@ -23,7 +23,7 @@ const Cities = React.forwardRef((props, ref) => {
ref={ref}
isInvalid={isInvalid}
onChange={onChange}
value={defaultValue.toUpperCase()}
value={value || ""}
custom
>
<option value={null} />
Expand Down
6 changes: 4 additions & 2 deletions app/client/src/features/sites/SiteDetailsEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ export default function SiteDetailsEdit({ form, initialValues, licence }) {
/>
</Col>
</Row>
{licence.licenceTypeId === LICENCE_TYPE_ID_APIARY || licence.licenceTypeId === LICENCE_TYPE_ID_GAME_FARM ? (
{licence.licenceTypeId === LICENCE_TYPE_ID_APIARY ||
licence.licenceTypeId === LICENCE_TYPE_ID_GAME_FARM ? (
<Row className="mt-3">
<Col lg={4}>
<Form.Group controlId="hiveCount">
Expand Down Expand Up @@ -172,7 +173,8 @@ export default function SiteDetailsEdit({ form, initialValues, licence }) {
) : (
<Cities
cities={cities}
{...register("city")}
value={watch("city")}
onChange={(e) => setValue("city", e.target.value)}
defaultValue={initialValues.city ?? "BC"}
isInvalid={errors.city}
/>
Expand Down

0 comments on commit d60156a

Please sign in to comment.