Skip to content

Commit

Permalink
Center "X" button using top + translate in filter input
Browse files Browse the repository at this point in the history
`IconButton`s change their size depending on whether mouse vs touch input is
being used. Change the positioning of the "X" button so that it remains centered
in both cases.

Fixes #1124
  • Loading branch information
robertknight committed Aug 1, 2023
1 parent 4c0b93b commit ccb9a22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion via/static/scripts/video_player/components/FilterInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export default function FilterInput({
data-testid="clear-filter-button"
title="Clear filter"
onClick={() => setFilter('')}
classes="absolute right-0 top-[1px]"
// Center button vertically within input. Note the button size will be
// larger on touch devices.
classes="absolute right-0 top-[50%] translate-y-[-50%]"
/>
)}
</div>
Expand Down

0 comments on commit ccb9a22

Please sign in to comment.