diff --git a/src/components/views/dialogs/DevtoolsDialog.tsx b/src/components/views/dialogs/DevtoolsDialog.tsx index 47fec2c045..98cb4c5edb 100644 --- a/src/components/views/dialogs/DevtoolsDialog.tsx +++ b/src/components/views/dialogs/DevtoolsDialog.tsx @@ -98,7 +98,7 @@ const DevtoolsDialog: React.FC = ({ roomId, threadRootId, onFinished }) })} ))} - + {evt.preventDefault(); evt.stopPropagation();}}>

{_t("common|options")}

diff --git a/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx b/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx index d1d4718fc6..aeb5ca48f5 100644 --- a/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx +++ b/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx @@ -104,7 +104,7 @@ export default class RoomUpgradeWarningDialog extends React.Component + {evt.preventDefault(); evt.stopPropagation();}}> + {evt.preventDefault(); evt.stopPropagation();}}> { return ( - + {evt.preventDefault(); evt.stopPropagation();}}> @@ -815,7 +815,7 @@ export default class Notifications extends React.PureComponent + {evt.preventDefault(); evt.stopPropagation();}}> {this.renderTopSection()} {this.renderCategory(RuleClass.VectorGlobal)} {this.renderCategory(RuleClass.VectorMentions)} @@ -823,7 +823,7 @@ export default class Notifications extends React.PureComponent {clearNotifsButton} - + ); } } diff --git a/src/components/views/settings/SetIntegrationManager.tsx b/src/components/views/settings/SetIntegrationManager.tsx index 6b41d0e1ce..cea0df9d94 100644 --- a/src/components/views/settings/SetIntegrationManager.tsx +++ b/src/components/views/settings/SetIntegrationManager.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { type EmptyObject } from "matrix-js-sdk/src/matrix"; -import { Root, SettingsToggleInput } from "@vector-im/compound-web"; +import { SettingsToggleInput } from "@vector-im/compound-web"; import { _t } from "../../../languageHandler"; import { IntegrationManagers } from "../../../integrations/IntegrationManagers"; @@ -75,14 +75,12 @@ export default class SetIntegrationManager extends React.Component {bodyText} {_t("integration_manager|explainer")} - - - + ); } diff --git a/src/components/views/settings/notifications/NotificationSettings2.tsx b/src/components/views/settings/notifications/NotificationSettings2.tsx index 051ae19409..fe3f9f87c6 100644 --- a/src/components/views/settings/notifications/NotificationSettings2.tsx +++ b/src/components/views/settings/notifications/NotificationSettings2.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { type JSX, useState } from "react"; -import { SettingsToggleInput } from "@vector-im/compound-web"; +import { Form, SettingsToggleInput } from "@vector-im/compound-web"; import NewAndImprovedIcon from "../../../../../res/img/element-icons/new-and-improved.svg"; import { useMatrixClientContext } from "../../../../contexts/MatrixClientContext"; @@ -93,6 +93,7 @@ export default function NotificationSettings2(): JSX.Element { return (
+ {hasPendingChanges && model !== null && ( } @@ -110,6 +111,7 @@ export default function NotificationSettings2(): JSX.Element { )} + {evt.preventDefault(); evt.stopPropagation();}}>
+
); diff --git a/src/components/views/settings/tabs/SettingsTab.tsx b/src/components/views/settings/tabs/SettingsTab.tsx index 967679df05..c7a9f9a212 100644 --- a/src/components/views/settings/tabs/SettingsTab.tsx +++ b/src/components/views/settings/tabs/SettingsTab.tsx @@ -37,9 +37,8 @@ export interface SettingsTabProps extends HTMLAttributes { */ const SettingsTab: React.FC = ({ children, className, ...rest }) => (
- -
{children}
-
+ {/* Prevent settings from doing any accidental submits. */} +
{children}
); diff --git a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx index b50eb22a7c..18d7693038 100644 --- a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx @@ -23,6 +23,7 @@ import SettingsTab from "../SettingsTab"; import { SettingsSection } from "../../shared/SettingsSection"; import { UrlPreviewSettings } from "../../../room_settings/UrlPreviewSettings"; import { MediaPreviewAccountSettings } from "../user/MediaPreviewAccountSettings"; +import { Form } from "@vector-im/compound-web"; interface IProps { room: Room; @@ -78,26 +79,28 @@ export default class GeneralRoomSettingsTab extends React.Component - - - + {evt.preventDefault(); evt.stopPropagation();}}> + + + - - - + + + - - {urlPreviewSettings} - - - - {leaveSection} - + + {urlPreviewSettings} + + + + {leaveSection} + + ); } diff --git a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx index 883b000d77..9f434cb4b6 100644 --- a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx @@ -17,7 +17,7 @@ import { EventType, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { InlineSpinner, SettingsToggleInput } from "@vector-im/compound-web"; +import { Form, InlineSpinner, SettingsToggleInput } from "@vector-im/compound-web"; import { Icon as WarningIcon } from "../../../../../../res/img/warning.svg"; import { _t } from "../../../../../languageHandler"; @@ -446,6 +446,7 @@ export default class SecurityRoomSettingsTab extends React.Component + {evt.preventDefault(); evt.stopPropagation();}}> {this.renderJoinRule()} {historySection} + ); diff --git a/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx index d03d8b7bb6..b314b0a84d 100644 --- a/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React, { type ChangeEventHandler, useCallback, useMemo, useState } from "react"; import { JoinRule, EventType, type RoomState, type Room } from "matrix-js-sdk/src/matrix"; import { type RoomPowerLevelsEventContent } from "matrix-js-sdk/src/types"; -import { SettingsToggleInput } from "@vector-im/compound-web"; +import { Form, SettingsToggleInput } from "@vector-im/compound-web"; import { _t } from "../../../../../languageHandler"; import { SettingsSubsection } from "../../shared/SettingsSubsection"; @@ -96,9 +96,11 @@ export const VoipRoomSettingsTab: React.FC = ({ room }) => { return ( - - - + {evt.preventDefault(); evt.stopPropagation();}}> + + + + ); diff --git a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx index df8c376e00..489d1a2e87 100644 --- a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx @@ -24,6 +24,7 @@ import ImageSizePanel from "../../ImageSizePanel"; import SettingsTab from "../SettingsTab"; import { SettingsSection } from "../../shared/SettingsSection"; import { SettingsSubsection } from "../../shared/SettingsSubsection"; +import { Form } from "@vector-im/compound-web"; interface IState { useBundledEmojiFont: boolean; @@ -102,11 +103,13 @@ export default class AppearanceUserSettingsTab extends React.Component - - - - {this.renderAdvancedSection()} - + {evt.preventDefault(); evt.stopPropagation();}}> + + + + {this.renderAdvancedSection()} + + ); diff --git a/src/components/views/settings/tabs/user/InviteRulesAccountSettings.tsx b/src/components/views/settings/tabs/user/InviteRulesAccountSettings.tsx index 523eed6b97..0ee0be2a5b 100644 --- a/src/components/views/settings/tabs/user/InviteRulesAccountSettings.tsx +++ b/src/components/views/settings/tabs/user/InviteRulesAccountSettings.tsx @@ -32,7 +32,7 @@ export const InviteRulesAccountSetting: FC = () => { } }, []); return ( - + {evt.preventDefault(); evt.stopPropagation();}}> { return SdkConfig.get("show_labs_settings") || SettingsStore.getValue("developerMode"); @@ -106,6 +107,7 @@ export default class LabsUserSettingsTab extends React.Component { return ( + {evt.preventDefault(); evt.stopPropagation();}}> {_t("labs|beta_description", { brand: SdkConfig.get("brand") })} @@ -137,6 +139,7 @@ export default class LabsUserSettingsTab extends React.Component { {labsSections} )} + ); } diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx index a2b999ddea..c1cb7674f5 100644 --- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { type ChangeEventHandler, type JSX, type ReactElement, useCallback, useEffect, useState } from "react"; -import { SettingsToggleControl } from "@vector-im/compound-web"; +import { Form, SettingsToggleControl } from "@vector-im/compound-web"; import { type NonEmptyArray } from "../../../../../@types/common"; import { _t, getCurrentLanguage } from "../../../../../languageHandler"; @@ -258,6 +258,7 @@ export default class PreferencesUserSettingsTab extends React.Component + {evt.preventDefault(); evt.stopPropagation();}}> {/* The heading string is still 'general' from where it was moved, but this section should become 'general' */} @@ -390,6 +391,7 @@ export default class PreferencesUserSettingsTab extends React.Component + ); } diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx index 1c85aada34..ee6104ba9f 100644 --- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx @@ -32,6 +32,7 @@ import { SettingsSubsection, SettingsSubsectionText } from "../../shared/Setting import { useOwnDevices } from "../../devices/useOwnDevices"; import { DiscoverySettings } from "../../discovery/DiscoverySettings"; import SetIntegrationManager from "../../SetIntegrationManager"; +import { Form } from "@vector-im/compound-web"; interface IIgnoredUserProps { userId: string; @@ -355,17 +356,19 @@ export default class SecurityUserSettingsTab extends React.Component - {warning} - - - {secureBackup} - {eventIndex} - - - - {posthogSection} - - {advancedSection} + {evt.preventDefault(); evt.stopPropagation();}}> + {warning} + + + {secureBackup} + {eventIndex} + + + + {posthogSection} + + {advancedSection} + ); } diff --git a/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx index ef43c07564..bf1c80ba50 100644 --- a/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx @@ -11,7 +11,7 @@ import React, { type ChangeEventHandler, type JSX, type ReactNode } from "react" import { logger } from "matrix-js-sdk/src/logger"; import { FALLBACK_ICE_SERVER } from "matrix-js-sdk/src/webrtc/call"; import { type EmptyObject } from "matrix-js-sdk/src/matrix"; -import { SettingsToggleInput } from "@vector-im/compound-web"; +import { Form, SettingsToggleInput } from "@vector-im/compound-web"; import { _t } from "../../../../../languageHandler"; import MediaDeviceHandler, { type IMediaDevices, MediaDeviceKindEnum } from "../../../../../MediaDeviceHandler"; @@ -187,55 +187,57 @@ export default class VoiceUserSettingsTab extends React.Component - - {requestButton} - - {speakerDropdown} - {microphoneDropdown} - - - - {webcamDropdown} - - - + {evt.preventDefault(); evt.stopPropagation();}}> + + {requestButton} + + {speakerDropdown} + {microphoneDropdown} + + + + {webcamDropdown} + + + - - - - - - - - - - + + + + + + + + + + + ); } diff --git a/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx b/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx index 0827966ddf..ebf550f1bf 100644 --- a/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx +++ b/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx @@ -15,7 +15,7 @@ import { JoinRule, type MatrixClient, } from "matrix-js-sdk/src/matrix"; -import { SettingsToggleInput } from "@vector-im/compound-web"; +import { Form, SettingsToggleInput } from "@vector-im/compound-web"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; @@ -160,24 +160,26 @@ const SpaceSettingsVisibilityTab: React.FC = ({ matrixClient: cli, space /> {advancedSection}
- { - setHistoryVisibility( - evt.target.checked ? HistoryVisibility.WorldReadable : HistoryVisibility.Shared, - ); - }} - helpMessage={_t("room_settings|visibility|history_visibility_anyone_space_description")} - disabled={!canSetHistoryVisibility} - disabledMessage={_t("room_settings|visibility|history_visibility_anyone_space_disabled")} - label={_t("room_settings|visibility|history_visibility_anyone_space")} - /> -

- - {_t("room_settings|visibility|history_visibility_anyone_space_recommendation")} - -

+ {evt.preventDefault(); evt.stopPropagation();}}> + { + setHistoryVisibility( + evt.target.checked ? HistoryVisibility.WorldReadable : HistoryVisibility.Shared, + ); + }} + helpMessage={_t("room_settings|visibility|history_visibility_anyone_space_description")} + disabled={!canSetHistoryVisibility} + disabledMessage={_t("room_settings|visibility|history_visibility_anyone_space_disabled")} + label={_t("room_settings|visibility|history_visibility_anyone_space")} + /> +

+ + {_t("room_settings|visibility|history_visibility_anyone_space_recommendation")} + +

+