Adding videos page hotkeys to help play and navigate videos. Adding f hotkey for all local search fields (channel/domain/etc). Focusing when opening cookie modals.

This commit is contained in:
Roland 2026-02-23 17:29:09 -07:00
parent 21c96d9501
commit ad0d93714a
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
8 changed files with 166 additions and 14 deletions

View file

@ -421,7 +421,7 @@ export function scrollToTopOfElement(element, smooth = true) {
});
}
const useClearableInput = (searchStr, onChange, onClear, onSubmit, size = 'small', placeholder = 'Search...', icon = 'search', clearDisabled = null) => {
const useClearableInput = (searchStr, onChange, onClear, onSubmit, size = 'small', placeholder = 'Search...', icon = 'search', clearDisabled = null, inputRef = null) => {
const [value, setValue] = useState(searchStr || '');
const [submitted, setSubmitted] = useState(false);
@ -497,6 +497,7 @@ const useClearableInput = (searchStr, onChange, onClear, onSubmit, size = 'small
size={size}
className='search-input'
action={action}
ref={inputRef}
/>;
return {value, submitted, clearButton, input, localOnSubmit, handleChange}
@ -510,10 +511,11 @@ export function SearchInput({
size = 'small',
placeholder = 'Search...',
icon = 'search',
inputRef = null,
...props
}) {
// A Semantic <Input> with a Clear button as the action.
let {input, localOnSubmit} = useClearableInput(searchStr, onChange, onClear, onSubmit, size, placeholder, icon);
let {input, localOnSubmit} = useClearableInput(searchStr, onChange, onClear, onSubmit, size, placeholder, icon, null, inputRef);
return <Form onSubmit={localOnSubmit} {...props} className='search-container'>
{input}