mirror of
https://github.com/gurnec/removeddit.git
synced 2026-03-11 08:54:27 +00:00
Work around 8-year-old Firefox bug
If the max comments setting was changed using only the spinner, it wasn't saved. See https://bugzilla.mozilla.org/show_bug.cgi?id=1012818
This commit is contained in:
parent
fe21a0760f
commit
2f4c8e0c62
1 changed files with 6 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import {connect, sort, filter, maxCommentsLimit} from '../../state'
|
|||
|
||||
const sortBy = props => {
|
||||
const [reloadVisible, setReloadVisible] = useState(false)
|
||||
const isFirefox = typeof InstallTrigger !== 'undefined'
|
||||
let usedMouse;
|
||||
|
||||
return (
|
||||
|
|
@ -37,7 +38,11 @@ const sortBy = props => {
|
|||
setReloadVisible(parseInt(e.target.value) > props.global.state.maxComments && props.global.state.maxComments < maxCommentsLimit)
|
||||
}} onBlur={e => {
|
||||
e.target.value = props.global.saveMaxComments(e.target.value)
|
||||
}} defaultValue={props.global.state.maxComments} type='number' maxLength='5' required min='100' max={maxCommentsLimit} step='100' />
|
||||
}} {
|
||||
...(isFirefox ? {onClick: e => {
|
||||
e.target.focus()
|
||||
}} : {})
|
||||
} defaultValue={props.global.state.maxComments} type='number' maxLength='5' required min='100' max={maxCommentsLimit} step='100' />
|
||||
{reloadVisible && <>
|
||||
<span className='space' />
|
||||
<input onClick={() => {props.global.loadMaxComments(); setReloadVisible(false)}} type='button' value='Reload' />
|
||||
|
|
|
|||
Loading…
Reference in a new issue