diff --git a/src/ui/component/common/paginate.jsx b/src/ui/component/common/paginate.jsx index da07d6d8a..3bd78fc85 100644 --- a/src/ui/component/common/paginate.jsx +++ b/src/ui/component/common/paginate.jsx @@ -5,7 +5,6 @@ import { Form, FormField } from 'component/common/form'; import ReactPaginate from 'react-paginate'; const PAGINATE_PARAM = 'page'; -const ENTER_KEY_CODE = 13; type Props = { loading: boolean, @@ -18,6 +17,7 @@ type Props = { function Paginate(props: Props) { const { totalPages = 1, loading, location, history, onPageChange } = props; const { search } = location; + const [textValue, setTextValue] = React.useState(''); const urlParams = new URLSearchParams(search); const currentPage = Number(urlParams.get(PAGINATE_PARAM)) || 1; @@ -31,11 +31,9 @@ function Paginate(props: Props) { } } - function handlePaginateKeyUp(e: SyntheticKeyboardEvent<*>) { - const newPage = Number(e.currentTarget.value); - const isEnterKey = e.keyCode === ENTER_KEY_CODE; - - if (newPage && isEnterKey && newPage > 0 && newPage <= totalPages) { + function handlePaginateKeyUp() { + const newPage = Number(textValue); + if (newPage && newPage > 0 && newPage <= totalPages) { handleChangePage(newPage); } } @@ -43,7 +41,7 @@ function Paginate(props: Props) { return ( // Hide the paginate controls if we are loading or there is only one page // It should still be rendered to trigger the onPageChange callback -
+ setTextValue(e.target.value)} className="paginate-channel" - onKeyUp={handlePaginateKeyUp} label={__('Go to page:')} type="text" name="paginate-file" diff --git a/static/app-strings.json b/static/app-strings.json index d0b0b4834..7552f1792 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -709,5 +709,7 @@ "This will add a Support button along side tipping. Similar to tips, supports help %discovery_link% but the LBC is returned to your wallet if revoked. Both also help secure your %vanity_names_link%.": "This will add a Support button along side tipping. Similar to tips, supports help %discovery_link% but the LBC is returned to your wallet if revoked. Both also help secure your %vanity_names_link%.", "Tip %amount% LBC": "Tip %amount% LBC", "Not enough credits": "Not enough credits", - "You have %credit_amount% in unclaimed rewards.": "You have %credit_amount% in unclaimed rewards." -} + "You have %credit_amount% in unclaimed rewards.": "You have %credit_amount% in unclaimed rewards.", + "You haven't downloaded anything from LBRY yet.": "You haven't downloaded anything from LBRY yet.", + "Explore new content": "Explore new content" +} \ No newline at end of file