[Enter] key autosave for new API key and webhook (#3955)

* Added functionality for onKeyDown for new webhook and new API key, to save when the user presses the [Enter] key

* Update SettingsDevelopersApiKeysNew.tsx

Fix for linter

* Update SettingsDevelopersWebhooksNew.tsx

Fix for linter

* Update SettingsDevelopersApiKeysNew.tsx

Got rid of extra space in if statement

* Update SettingsDevelopersWebhooksNew.tsx

Got rid of extra space for if statement

* Update SettingsDevelopersApiKeysNew.tsx

prettier

* Update SettingsDevelopersWebhooksNew.tsx

prettier

* Fix linter

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
Jonathanlemon
2024-02-19 22:37:02 +01:00
committed by GitHub
co-authored by Félix Malfait
parent 09783912f3
commit 116254243d
2 changed files with 10 additions and 0 deletions
@@ -83,6 +83,11 @@ export const SettingsDevelopersApiKeysNew = () => {
<TextInput
placeholder="E.g. backoffice integration"
value={formValues.name}
onKeyDown={(e) => {
if (e.key === 'Enter') {
handleSave();
}
}}
onChange={(value) => {
setFormValues((prevState) => ({
...prevState,
@@ -60,6 +60,11 @@ export const SettingsDevelopersWebhooksNew = () => {
<TextInput
placeholder="URL"
value={formValues.targetUrl}
onKeyDown={(e) => {
if (e.key === 'Enter') {
handleSave();
}
}}
onChange={(value) => {
setFormValues((prevState) => ({
...prevState,