mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Prevent mouse wheel window scrolling on other number fields (#5283)
This commit is contained in:
@@ -12,6 +12,7 @@ import { FormattedMessage, FormattedNumber, useIntl } from "react-intl";
|
||||
import useFocus from "src/utils/focus";
|
||||
import { Icon } from "../Shared/Icon";
|
||||
import { faCheck, faChevronDown } from "@fortawesome/free-solid-svg-icons";
|
||||
import { useStopWheelScroll } from "src/utils/form";
|
||||
|
||||
const PageCount: React.FC<{
|
||||
totalPages: number;
|
||||
@@ -32,6 +33,8 @@ const PageCount: React.FC<{
|
||||
}
|
||||
}, [showSelectPage, pageFocus]);
|
||||
|
||||
useStopWheelScroll(pageInput);
|
||||
|
||||
const pageOptions = useMemo(() => {
|
||||
const maxPagesToShow = 10;
|
||||
const min = Math.max(1, currentPage - maxPagesToShow / 2);
|
||||
@@ -98,6 +101,7 @@ const PageCount: React.FC<{
|
||||
<Popover id="select_page_popover">
|
||||
<Form inline>
|
||||
<InputGroup>
|
||||
{/* can't use NumberField because of the ref */}
|
||||
<Form.Control
|
||||
type="number"
|
||||
min={1}
|
||||
|
||||
Reference in New Issue
Block a user