Skip to content

Commit 15eea70

Browse files
Clear Input Field When Opening Add Team Modal (#9009)
### Steps to test: - Go to teams page - Add a team using the modal - Click "Add Team" again -> field for team name should be empty - Same if you only enter a team name, then cancel and open the modal again -> field should be empty ### Issues: - fixes #8497 ------ (Please delete unneeded items, merge only when none are left open) - [x] Added changelog entry (create a `$PR_NUMBER.md` file in `unreleased_changes` or use `./tools/create-changelog-entry.py`) - [ ] Added migration guide entry if applicable (edit the same file as for the changelog) - [ ] Updated [documentation](../blob/master/docs) if applicable - [ ] Adapted [wk-libs python client](https://github.com/scalableminds/webknossos-libs/tree/master/webknossos/webknossos/client) if relevant API parts change - [ ] Removed dev-only changes like prints and application.conf edits - [x] Considered [common edge cases](../blob/master/.github/common_edge_cases.md) - [ ] Needs datastore update after deployment
1 parent 6502ec6 commit 15eea70

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

frontend/javascripts/admin/team/create_team_modal_view.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type Props = {
99
isOpen: boolean;
1010
};
1111

12-
function CreateTeamModalForm({ onOk: onOkCallback, onCancel, isOpen }: Props) {
12+
function CreateTeamModalForm({ onOk: onOkCallback, onCancel: onCancelCallback, isOpen }: Props) {
1313
const [form] = Form.useForm();
1414

1515
const onOk = async () => {
@@ -26,10 +26,16 @@ function CreateTeamModalForm({ onOk: onOkCallback, onCancel, isOpen }: Props) {
2626
],
2727
};
2828
const team = await createTeam(newTeam);
29+
form.resetFields();
2930
onOkCallback(team);
3031
});
3132
};
3233

34+
const onCancel = () => {
35+
form.resetFields();
36+
onCancelCallback();
37+
};
38+
3339
return (
3440
<Modal open={isOpen} title="Add a New Team" okText="Ok" onCancel={onCancel} onOk={onOk}>
3541
<Shortcut keys="enter" onTrigger={onOk} supportInputElements />

unreleased_changes/9009.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Fixed
2+
- The modal to create a new team now always displays an empty input field when opened, preventing any previously entered text from appearing.

0 commit comments

Comments
 (0)