mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-01-25 05:51:04 -08:00
fix: sometimes event.target.value can be undefined
this fixes https://github.com/tiddly-gittly/TiddlyGit-Desktop/issues/95
This commit is contained in:
parent
6eace3a915
commit
473ea84457
1 changed files with 2 additions and 0 deletions
|
|
@ -82,6 +82,7 @@ export default function FindInPage(): JSX.Element | null {
|
|||
margin="dense"
|
||||
onChange={(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
||||
const value = event.target.value;
|
||||
if (!value) return;
|
||||
textSetter(value);
|
||||
if (value.length > 0) {
|
||||
void window.service.window.findInPage(value, true);
|
||||
|
|
@ -91,6 +92,7 @@ export default function FindInPage(): JSX.Element | null {
|
|||
}}
|
||||
onInput={(event: React.FormEvent<HTMLInputElement>) => {
|
||||
const value = event.currentTarget.value;
|
||||
if (!value) return;
|
||||
textSetter(value);
|
||||
if (value.length > 0) {
|
||||
void window.service.window.findInPage(value, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue