insomnia/packages/insomnia-app/app/ui/components/modals
Dimitri Mitropoulos 860565f3a6
fixes react controlled input error (#3391)
* fix ts-expect-error

* removes useless await

see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/await-thenable.md

We're not quite ready to have this rule on everywhere, but in this case I can see that it's correct to follow.

* add comment about magic number

and moves the assignment to the one place it's used

I opted not to make a ticket because we are recently running out of tickets and this seems to be a relatively small thing @reynolek please confirm this is the correct course of action.

* initialize ref to reflect reality (and include actual type)

* fixes root cause of error, inlines one-liners

the error with the type of `_handleInputColorChange` was due to `onChange` being the wrong prop to use (where `onChange` is the one we want).

* use onChange instead of onInput to access correct types

ultimately, since react's behavior diverged from the DOM behavior to match onInput, this should have no effect on any functionality since react assigns this event to `onChange` anyway.  see https://github.com/facebook/react/blob/master/fixtures/attribute-behavior/src/attributes.js#L2089

* clears remaining ts-expect-errors in file

* updates fallback call per review feedback
2021-05-19 08:24:01 -04:00
..
__mocks__ [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
add-key-combination-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
alert-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
ask-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
code-prompt-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
cookie-modify-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
cookies-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
environment-edit-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
error-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
export-requests-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
filter-help-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
generate-code-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
generate-config-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
git-branches-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
git-log-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
git-repository-settings-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
git-staging-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
index.ts [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
login-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
move-request-group-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
nunjucks-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
payment-notification-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
prompt-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
proto-files-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
request-create-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
request-render-error-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
request-settings-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
request-switcher-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
response-debug-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
select-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
settings-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00
sync-branches-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
sync-delete-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
sync-history-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
sync-merge-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
sync-share-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
sync-staging-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
workspace-environments-edit-modal.tsx fixes react controlled input error (#3391) 2021-05-19 08:24:01 -04:00
workspace-settings-modal.tsx use same array-type rule, project-wide (#3395) 2021-05-19 08:32:18 +12:00
wrapper-modal.tsx [TypeScript] Phase 1 & 2 (#3370) 2021-05-12 18:35:00 +12:00