Skip to content

Commit

Permalink
After clicking "Add metric", give focus to the filter field automatic…
Browse files Browse the repository at this point in the history
…ally.

Closes #10743.
  • Loading branch information
fniessink committed Feb 6, 2025
1 parent 5376a39 commit 0be7f8e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export function AddDropdownButton({ itemSubtypes, itemType, onClick, allItemSubt
</Tooltip>
<Popover id="dropdown-menu" anchorEl={anchorEl} onClose={() => setAnchorEl(null)} open={Boolean(anchorEl)}>
<TextField
autoFocus
fullWidth
label={`Filter ${itemType} types`}
onChange={(event) => setQuery(event.target.value)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ test("AddDropdownButton mouse navigation", async () => {
await act(async () => {
fireEvent.click(screen.getByText(/Add foo/))
})
expect(screen.getByLabelText(/Filter/)).toHaveFocus()
await act(async () => {
fireEvent.click(screen.getByText(/Sub 2/))
})
Expand All @@ -49,6 +50,7 @@ test("AddDropdownButton keyboard navigation", async () => {
await act(async () => {
fireEvent.click(screen.getByText(/Add foo/))
})
expect(screen.getByLabelText(/Filter/)).toHaveFocus()
await act(async () => {
fireEvent.keyDown(screen.getByText(/Available/), { key: "ArrowDown" })
})
Expand Down
1 change: 1 addition & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ If your currently installed *Quality-time* version is not the latest version, pl
### Added

- Support the new SonarQube impact severity levels "blocker" and "info", introduced in SonarQube v10.8. Closes [#10708](https://github.com/ICTU/quality-time/issues/10708).
- After clicking "Add metric", give focus to the filter field automatically. Closes [#10743](https://github.com/ICTU/quality-time/issues/10743).

### Fixed

Expand Down

0 comments on commit 0be7f8e

Please sign in to comment.