mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix null reference TypeScript error - searchInput
This commit is contained in:
parent
9c7ba63696
commit
a08f8e3f75
1 changed files with 5 additions and 0 deletions
|
@ -57,6 +57,11 @@ const SearchFields: FunctionComponent<SearchFieldsProps> = ({ onSearch = () => {
|
||||||
const value = (e as CustomEvent).detail.value;
|
const value = (e as CustomEvent).detail.value;
|
||||||
const searchInput = getSearchInput();
|
const searchInput = getSearchInput();
|
||||||
|
|
||||||
|
if (!searchInput) {
|
||||||
|
console.error('Unexpected null reference');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (value === 'backspace') {
|
if (value === 'backspace') {
|
||||||
const currentValue = searchInput.value;
|
const currentValue = searchInput.value;
|
||||||
searchInput.value = currentValue.length ? currentValue.substring(0, currentValue.length - 1) : '';
|
searchInput.value = currentValue.length ? currentValue.substring(0, currentValue.length - 1) : '';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue