chore: clean up input.type property access (#1975)

Follows-up 4218c4ce64.

When accessing the IDL property, values tend to be reflected in a normalised
type and form. In the case of HTMLInputElement.type, this means the
returned value is always one of the supported and canonical lowercase
values regardless of what value the corresponding attribute holds, or
even if the attribute doesn't exist (the default will still be "text").
fix-string
Timo Tijhof 2021-02-28 22:46:23 +00:00 zatwierdzone przez GitHub
rodzic b9496c9bca
commit 5573f7cf32
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -26,7 +26,7 @@
const { target, key } = event
const isRadio = target &&
target.tagName === 'INPUT' &&
(target.type || '').toLowerCase() === 'radio'
target.type === 'radio'
const isArrow = key === 'ArrowUp' || key === 'ArrowDown'
return isRadio && isArrow
}