diff --git a/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx b/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx index 673ff5e399..9d6dadb0f3 100644 --- a/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx +++ b/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx @@ -178,7 +178,9 @@ export default class ExportE2eKeysDialog extends React.Component type="password" disabled={disableForm} autoComplete="new-password" - fieldRef={(field) => (this.fieldPassword = field)} + fieldRef={(field) => { + this.fieldPassword = field; + }} />
@@ -195,7 +197,9 @@ export default class ExportE2eKeysDialog extends React.Component type="password" disabled={disableForm} autoComplete="new-password" - fieldRef={(field) => (this.fieldPasswordConfirm = field)} + fieldRef={(field) => { + this.fieldPasswordConfirm = field; + }} />
diff --git a/src/components/structures/auth/ForgotPassword.tsx b/src/components/structures/auth/ForgotPassword.tsx index 5e0c947591..ce5d01f3c5 100644 --- a/src/components/structures/auth/ForgotPassword.tsx +++ b/src/components/structures/auth/ForgotPassword.tsx @@ -388,7 +388,9 @@ export default class ForgotPassword extends React.Component { label={_td("auth|change_password_new_label")} value={this.state.password} minScore={PASSWORD_MIN_SCORE} - fieldRef={(field) => (this.fieldPassword = field)} + fieldRef={(field) => { + this.fieldPassword = field; + }} onChange={this.onInputChanged.bind(this, "password")} autoComplete="new-password" /> @@ -399,7 +401,9 @@ export default class ForgotPassword extends React.Component { labelInvalid={_td("auth|reset_password|passwords_mismatch")} value={this.state.password2} password={this.state.password} - fieldRef={(field) => (this.fieldPasswordConfirm = field)} + fieldRef={(field) => { + this.fieldPasswordConfirm = field; + }} onChange={this.onInputChanged.bind(this, "password2")} autoComplete="new-password" /> diff --git a/src/components/views/auth/RegistrationForm.tsx b/src/components/views/auth/RegistrationForm.tsx index 800b20a130..b953d5883b 100644 --- a/src/components/views/auth/RegistrationForm.tsx +++ b/src/components/views/auth/RegistrationForm.tsx @@ -456,7 +456,9 @@ export default class RegistrationForm extends React.PureComponent (this[RegistrationField.Email] = field)} + fieldRef={(field) => { + this[RegistrationField.Email] = field; + }} label={emailLabel} value={this.state.email} validationRules={this.validateEmailRules.bind(this)} @@ -471,7 +473,9 @@ export default class RegistrationForm extends React.PureComponent (this[RegistrationField.Password] = field)} + fieldRef={(field) => { + this[RegistrationField.Password] = field; + }} minScore={PASSWORD_MIN_SCORE} value={this.state.password} onChange={this.onPasswordChange} @@ -486,7 +490,9 @@ export default class RegistrationForm extends React.PureComponent (this[RegistrationField.PasswordConfirm] = field)} + fieldRef={(field) => { + this[RegistrationField.PasswordConfirm] = field; + }} autoComplete="new-password" value={this.state.passwordConfirm} password={this.state.password} @@ -513,9 +519,9 @@ export default class RegistrationForm extends React.PureComponent ); return ( - ( { - (this[RegistrationField.PhoneNumber] = field); + { + this[RegistrationField.PhoneNumber] = field; }} type="text" label={phoneLabel} @@ -523,16 +529,16 @@ export default class RegistrationForm extends React.PureComponent) + /> ); } public renderUsername(): ReactNode { return ( - ( { - (this[RegistrationField.Username] = field); + ref={(field) => { + this[RegistrationField.Username] = field; }} type="text" autoFocus={true} @@ -544,7 +550,7 @@ export default class RegistrationForm extends React.PureComponent) + /> ); } diff --git a/src/components/views/messages/CodeBlock.tsx b/src/components/views/messages/CodeBlock.tsx index 57935cb999..6b6ab31ae8 100644 --- a/src/components/views/messages/CodeBlock.tsx +++ b/src/components/views/messages/CodeBlock.tsx @@ -119,7 +119,9 @@ const CodeBlock: React.FC = ({ children, onHeightChanged }) => {
{ + highlightCode(div); + }} /> {expandCollapseButton} diff --git a/src/components/views/settings/ChangePassword.tsx b/src/components/views/settings/ChangePassword.tsx index 8206b30a93..4ca156bee6 100644 --- a/src/components/views/settings/ChangePassword.tsx +++ b/src/components/views/settings/ChangePassword.tsx @@ -327,11 +327,11 @@ export default class ChangePassword extends React.Component { switch (this.state.phase) { case Phase.Edit: return ( - (
+
{ - (this[FIELD_OLD_PASSWORD] = field); + ref={(field) => { + this[FIELD_OLD_PASSWORD] = field; }} type="password" label={_t("auth|change_password_current_label")} @@ -342,7 +342,9 @@ export default class ChangePassword extends React.Component {
(this[FIELD_NEW_PASSWORD] = field)} + fieldRef={(field) => { + this[FIELD_NEW_PASSWORD] = field; + }} type="password" label={_td("auth|change_password_new_label")} minScore={PASSWORD_MIN_SCORE} @@ -355,8 +357,8 @@ export default class ChangePassword extends React.Component {
{ - (this[FIELD_NEW_PASSWORD_CONFIRM] = field); + ref={(field) => { + this[FIELD_NEW_PASSWORD_CONFIRM] = field; }} type="password" label={_t("auth|change_password_confirm_label")} @@ -373,7 +375,7 @@ export default class ChangePassword extends React.Component { > {this.props.buttonLabel || _t("auth|change_password_action")} - ) + ); case Phase.Uploading: return ( diff --git a/test/unit-tests/components/structures/FilePanel-test.tsx b/test/unit-tests/components/structures/FilePanel-test.tsx index 25bdd99676..974b8c6d02 100644 --- a/test/unit-tests/components/structures/FilePanel-test.tsx +++ b/test/unit-tests/components/structures/FilePanel-test.tsx @@ -65,7 +65,9 @@ describe("FilePanel", () => { roomId={room.roomId} onClose={jest.fn()} resizeNotifier={new ResizeNotifier()} - ref={(ref) => (filePanel = ref)} + ref={(ref) => { + filePanel = ref; + }} />, ); await screen.findByText("No files visible in this room"); diff --git a/test/unit-tests/components/structures/TimelinePanel-test.tsx b/test/unit-tests/components/structures/TimelinePanel-test.tsx index 442ed1c1d2..1d4360b013 100644 --- a/test/unit-tests/components/structures/TimelinePanel-test.tsx +++ b/test/unit-tests/components/structures/TimelinePanel-test.tsx @@ -204,7 +204,9 @@ describe("TimelinePanel", () => { timelineSet={timelineSet} manageReadMarkers={true} manageReadReceipts={true} - ref={(ref) => (timelinePanel = ref)} + ref={(ref) => { + timelinePanel = ref; + }} />, ); await flushPromises();