[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:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user