Stop TS breaking everything

This is very annoying - I built this, it worked, but `tslint`
changed ['readOnly'] to .readOnly and broke Tridactyl
This commit is contained in:
Oliver Blanthorn 2020-05-27 12:56:48 +01:00
parent cf1c136f35
commit 4276cd68e9
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -23,7 +23,7 @@ const logger = new Logging.Logger("dom")
*/
export function isTextEditable(element: Element) {
if (element) {
if (element.readOnly === true) return false
if ((element as any).readOnly === true) return false
// HTML is always upper case, but XHTML is not necessarily upper case
if (element.nodeName.toUpperCase() === "INPUT") {
return isEditableHTMLInput(element as HTMLInputElement)