diff --git a/client/admin/customEmoji/CustomEmoji.js b/client/admin/customEmoji/CustomEmoji.js index a12987a5bfdc..1837621237c8 100644 --- a/client/admin/customEmoji/CustomEmoji.js +++ b/client/admin/customEmoji/CustomEmoji.js @@ -12,7 +12,7 @@ const FilterByText = ({ setFilter, ...props }) => { useEffect(() => { setFilter({ text }); }, [text]); - return + return e.preventDefault(), [])} display='flex' flexDirection='column' {...props}> } onChange={handleChange} value={text} /> ; }; diff --git a/client/admin/customSounds/AdminSounds.js b/client/admin/customSounds/AdminSounds.js index f6e45a716715..5800ecf719ce 100644 --- a/client/admin/customSounds/AdminSounds.js +++ b/client/admin/customSounds/AdminSounds.js @@ -13,7 +13,7 @@ const FilterByText = ({ setFilter, ...props }) => { useEffect(() => { setFilter({ text }); }, [text]); - return + return e.preventDefault(), [])} display='flex' flexDirection='column' {...props}> } onChange={handleChange} value={text} /> ; }; diff --git a/client/admin/customUserStatus/CustomUserStatus.js b/client/admin/customUserStatus/CustomUserStatus.js index 0052bdfa7c62..6b62d22ccbec 100644 --- a/client/admin/customUserStatus/CustomUserStatus.js +++ b/client/admin/customUserStatus/CustomUserStatus.js @@ -14,7 +14,7 @@ const FilterByText = ({ setFilter, ...props }) => { useEffect(() => { setFilter({ text }); }, [text]); - return + return e.preventDefault(), [])} display='flex' flexDirection='column' {...props}> } onChange={handleChange} value={text} /> ; }; diff --git a/client/admin/integrations/IncomingWebhookForm.js b/client/admin/integrations/IncomingWebhookForm.js index f25ba8b304f0..4bf2e20a1f9d 100644 --- a/client/admin/integrations/IncomingWebhookForm.js +++ b/client/admin/integrations/IncomingWebhookForm.js @@ -1,4 +1,4 @@ -import React, { useMemo } from 'react'; +import React, { useMemo, useCallback } from 'react'; import { Field, TextInput, Box, ToggleSwitch, Icon, TextAreaInput, FieldGroup, Margins } from '@rocket.chat/fuselage'; import { useTranslation } from '../../contexts/TranslationContext'; @@ -51,7 +51,7 @@ export default function IncomingWebhookForm({ formValues, formHandlers, extraDat const hilightedExampleJson = hilightCode('json', JSON.stringify(exampleData, null, 2)); - return + return e.preventDefault(), [])} qa-admin-user-edit='form' { ...props }> {useMemo(() => diff --git a/client/admin/integrations/IntegrationsTable.js b/client/admin/integrations/IntegrationsTable.js index 582485154019..e36ba8c3f864 100644 --- a/client/admin/integrations/IntegrationsTable.js +++ b/client/admin/integrations/IntegrationsTable.js @@ -21,7 +21,7 @@ const FilterByTypeAndText = React.memo(({ setFilter, ...props }) => { setFilter({ text }); }, [text]); - return + return e.preventDefault(), [])} display='flex' flexDirection='column' {...props}> } onChange={handleChange} value={text} /> ; }); diff --git a/client/admin/integrations/OutgoiongWebhookForm.js b/client/admin/integrations/OutgoiongWebhookForm.js index 2f6fe9fa4900..7435dbb6fbc4 100644 --- a/client/admin/integrations/OutgoiongWebhookForm.js +++ b/client/admin/integrations/OutgoiongWebhookForm.js @@ -10,7 +10,7 @@ import { Select, Accordion, } from '@rocket.chat/fuselage'; -import React, { useMemo } from 'react'; +import React, { useMemo, useCallback } from 'react'; import { useHilightCode } from '../../hooks/useHilightCode'; import { useExampleData } from './exampleIncomingData'; @@ -95,7 +95,7 @@ export default function OutgoingWebhookForm({ formValues, formHandlers, append, const hilightedExampleJson = hilightCode('json', JSON.stringify(exampleData, null, 2)); - return + return e.preventDefault(), [])} qa-admin-user-edit='form' { ...props }> diff --git a/client/admin/mailer/Mailer.js b/client/admin/mailer/Mailer.js index b96718bad53a..fb423b97b4ce 100644 --- a/client/admin/mailer/Mailer.js +++ b/client/admin/mailer/Mailer.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState, useCallback } from 'react'; import { TextInput, TextAreaInput, Field, FieldGroup, CheckBox, Button, Icon, ButtonGroup } from '@rocket.chat/fuselage'; import { isEmail } from '../../../app/utils/lib/isEmail.js'; @@ -25,7 +25,7 @@ export function Mailer({ sendMail = () => {} }) { - + e.preventDefault(), [])} method='post'> {t('From')} diff --git a/client/admin/rooms/EditRoom.js b/client/admin/rooms/EditRoom.js index f77b06334afb..6d46ae424fef 100644 --- a/client/admin/rooms/EditRoom.js +++ b/client/admin/rooms/EditRoom.js @@ -81,7 +81,7 @@ function EditRoom({ room, onChange }) { const isFavorite = newData.favorite ?? !!room.favorite; const isFeatured = newData.featured ?? !!room.featured; - return + return e.preventDefault(), [])}> {deleted && } diff --git a/client/admin/rooms/RoomsTable.js b/client/admin/rooms/RoomsTable.js index e85b975c58d8..57fbb87a3b08 100644 --- a/client/admin/rooms/RoomsTable.js +++ b/client/admin/rooms/RoomsTable.js @@ -44,7 +44,7 @@ const FilterByTypeAndText = ({ setFilter, ...props }) => { const idOmnichannel = useUniqueId(); const idDiscussions = useUniqueId(); - return + return e.preventDefault(), [])} display='flex' flexDirection='column' {...props}> } onChange={handleChange} value={text} /> diff --git a/client/admin/rooms/edit/EditRoom.js b/client/admin/rooms/edit/EditRoom.js index 7638bebcc00c..3ba4b679a911 100644 --- a/client/admin/rooms/edit/EditRoom.js +++ b/client/admin/rooms/edit/EditRoom.js @@ -81,7 +81,7 @@ function EditRoom({ room, onChange }) { const isFavorite = newData.favorite ?? !!room.favorite; const isFeatured = newData.featured ?? !!room.featured; - return + return e.preventDefault(), [])}> {deleted && } diff --git a/client/admin/users/AddUser.js b/client/admin/users/AddUser.js index a84f36824521..3b1076655daf 100644 --- a/client/admin/users/AddUser.js +++ b/client/admin/users/AddUser.js @@ -1,4 +1,4 @@ -import React, { useMemo, useState } from 'react'; +import React, { useMemo, useState, useCallback } from 'react'; import { Field, TextInput, Box, ToggleSwitch, Icon, TextAreaInput, MultiSelectFiltered, Margins, Button } from '@rocket.chat/fuselage'; import { useTranslation } from '../../contexts/TranslationContext'; @@ -57,7 +57,7 @@ export function AddUser({ roles, ...props }) { const availableRoles = roleData && roleData.roles ? roleData.roles.map(({ _id, description }) => [_id, description || _id]) : []; - return + return e.preventDefault(), [])} { ...props }> {t('Name')} diff --git a/client/admin/users/EditUser.js b/client/admin/users/EditUser.js index 1feb1eb82c34..055b61576116 100644 --- a/client/admin/users/EditUser.js +++ b/client/admin/users/EditUser.js @@ -1,4 +1,4 @@ -import React, { useMemo, useState } from 'react'; +import React, { useMemo, useState, useCallback } from 'react'; import { Field, TextInput, Box, Skeleton, ToggleSwitch, Icon, TextAreaInput, MultiSelectFiltered, Margins, Button } from '@rocket.chat/fuselage'; import { useTranslation } from '../../contexts/TranslationContext'; @@ -112,7 +112,7 @@ export function EditUser({ data, roles, ...props }) { const setRandomPassword = newData.setRandomPassword || false; const requirePasswordChange = setRandomPassword || newData.requirePasswordChange || false; - return + return e.preventDefault(), [])} qa-admin-user-edit='form' { ...props }> {t('Name')} diff --git a/client/admin/users/UserInfo.js b/client/admin/users/UserInfo.js index 93447ce3b669..bc1dd867be2c 100644 --- a/client/admin/users/UserInfo.js +++ b/client/admin/users/UserInfo.js @@ -1,4 +1,4 @@ -import React, { useMemo, useState, useEffect } from 'react'; +import React, { useMemo, useState, useEffect, useCallback } from 'react'; import { Box, Avatar, Margins, Skeleton, Chip, Tag } from '@rocket.chat/fuselage'; import moment from 'moment'; @@ -64,7 +64,7 @@ export function UserInfo({ data, onChange, ...props }) { const avatarUrl = roomTypes.getConfig('d').getAvatarPath({ name: data.username || data.name, type: 'd', _id: data._id }); - return + return e.preventDefault(), [])} {...props}> diff --git a/client/admin/users/UsersTable.js b/client/admin/users/UsersTable.js index d664b3b96c32..72bb1972fec8 100644 --- a/client/admin/users/UsersTable.js +++ b/client/admin/users/UsersTable.js @@ -18,7 +18,7 @@ const FilterByText = ({ setFilter, ...props }) => { useEffect(() => { setFilter({ text }); }, [text]); - return + return e.preventDefault(), [])} display='flex' flexDirection='column' {...props}> } onChange={handleChange} value={text} /> ; };