From 51449b6b2cc12c2fd135b11f048705b7afc628b0 Mon Sep 17 00:00:00 2001 From: Thomas Zerr Date: Thu, 9 Jan 2025 15:29:30 +0100 Subject: [PATCH] Fix no initial source branch set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changelog is omitted, because the bug was never released Co-authored-by: René Pfeuffer --- scm-ui/ui-components/src/forms/Select.tsx | 2 +- scm-ui/ui-webapp/src/repos/branches/components/BranchForm.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scm-ui/ui-components/src/forms/Select.tsx b/scm-ui/ui-components/src/forms/Select.tsx index bc216219c0..783a8d69cb 100644 --- a/scm-ui/ui-components/src/forms/Select.tsx +++ b/scm-ui/ui-components/src/forms/Select.tsx @@ -95,7 +95,7 @@ const InnerSelect: FC> = ({ if (!value && field.current?.value) { if (props.onChange) { if (isUsingRef(props)) { - const event = new Event("change"); + const event: Event = new CustomEvent("change", { bubbles: true, detail: { target: field } }); field.current?.dispatchEvent(event); } else if (isLegacy(props)) { props.onChange(field.current?.value, name); diff --git a/scm-ui/ui-webapp/src/repos/branches/components/BranchForm.tsx b/scm-ui/ui-webapp/src/repos/branches/components/BranchForm.tsx index 59976867e7..c62a3e8985 100644 --- a/scm-ui/ui-webapp/src/repos/branches/components/BranchForm.tsx +++ b/scm-ui/ui-webapp/src/repos/branches/components/BranchForm.tsx @@ -28,7 +28,7 @@ type Props = { disabled?: boolean; }; -const autoFocus = (el) => el?.focus(); +const autoFocus = (el: HTMLSelectElement) => el?.focus(); const BranchForm: FC = ({ submitForm, branches, disabled, transmittedName, loading }) => { const [t] = useTranslation("repos");